You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
Can I use pkg's bundled executable file as node itself? #864
Assume I have a bundled file named as bundleFile. It should contains the whole nodejs runtime and other resources including node libraries、glob resources and so on.
And can I use it to run other script files? Like: (the input form is not proper but you know what I mean) bundleFile other.js
Because bundleFile has the whole nodejs runtime, it should be possible technically. And I swear that I have seem this implementation on other tools.
Activity
cspotcode commentedon Mar 16, 2020
Pretty sure you would need your .js code to handle this, for example, by parsing the argv array and executing the right
require()statement.igorklopov commentedon Mar 16, 2020
You need to set
PKG_EXECPATHenv var toPKG_INVOKE_NODEJSwhen running bundled executable. For examplePKG_EXECPATH=PKG_INVOKE_NODEJS ./yourapp -p 42RogerKang commentedon Mar 18, 2020
It works, thanks!
RogerKang commentedon Mar 18, 2020
Thanks! It could be an option.