-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packing heapdump using *pkg* in a Node.js executable on Windows #115
Comments
Perhaps not exactly what you're asking for but newer Node.js versions give you programmatic access to the heap profiler through the inspector API. It's the |
Thanks for the tip, but unfortunately I can't move to Node 10.x yet due to constraints in other packages I need. |
I had a similar situation (tried to make Win executable with [email protected] including heapdump module), but I had different output: pkg/prelude/bootstrap.js:1178
throw error;
^
Error: Module did not self-register.
at Object.Module._extensions..node (module.js:662:18)
at Module.load (module.js:552:32)
at tryModuleLoad (module.js:495:12)
at Function.Module._load (module.js:487:3)
at Module.require (module.js:577:17)
at Module.require (pkg/prelude/bootstrap.js:1159:31)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\snapshot\hello-world\node_modules\heapdump\index.js:16:15)
at Module._compile (pkg/prelude/bootstrap.js:1254:22)
at Object.Module._extensions..js (module.js:644:10)
at Module.load (module.js:552:32)
at tryModuleLoad (module.js:495:12)
at Function.Module._load (module.js:487:3)
at Module.require (module.js:577:17)
at Module.require (pkg/prelude/bootstrap.js:1159:31) The real error (wrong executable's name) was disguised as error with wrong written addon. { http_parser: '2.7.0',
node: '8.9.0',
v8: '6.1.534.46',
uv: '1.15.0',
zlib: '1.2.11',
ares: '1.10.1-DEV',
modules: '57',
nghttp2: '1.25.0',
openssl: '1.0.2l',
icu: '59.1',
unicode: '9.0',
cldr: '31.0.1',
tz: '2017b' ,
node-gyp: '3.6.2'} It might be worth to pay attention in the relevant section of Caveats for windows. |
@den4md same here, and i am facing another cross-platform packing issue. i use
|
I use pkg to package my Node.js application into a single binary executable on Windows. Included in my application (as a package.json dependency) is heapdump. Unfortunately, when packaged with pkg the resulting binary will not run and results in an
I traced this down to the fact heapdump is compiled with
set in the binding.gyp file. This means the addon is expected to be run via an executable named either node.exe or iojs.exe. Unfortunately, the output name of my pkg executable is not one of those two names. As a result, since the heapdump addon has dependencies on exported V8 classes, it will not resolve the symbols it needs and crashes with the (above) error. If I rename my application's *.exe file to node.exe then the heapdump module loads correctly and the application runs as expected.
So, my issue is I want to include heapdump with my binary executable but I cannot name it node.exe. I tried enabling
'win_delay_hook': 'true'
which should allow me to name my application whatever I want but the Window's linker complains with the following:This appears to do with the fact that the C++ classes that V8 exports (and heapdump uses) have virtual methods. This issue seems to have been brought up here but it's not clear if there is a work-around that is available.
So, I am looking for a work-around or mechanism that will allow me to package heapdump with my application without forcing me to rename my entire application
node.exe
. Can anyone offer a suggestion that allows heapdump to be packaged withpkg
as a single executable?The text was updated successfully, but these errors were encountered: