pm2 package as a single binary
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
I use pm2 for a non node environment, and do not want to install node and npm, then I try to package this into a single binary with pkg tool, but fail.
As per: 4505 single binary can be build using https://getpm2.com/ but the website not available anymore. Can I get the instructions for this ?
some info:
pkg /usr/local/lib/node_modules/pm2/bin/pm2 -t node-linux-x64
pkg@4.4.0
Warning Cannot resolve 'confPath'
/usr/local/lib/node_modules/pm2/lib/Common.js
Dynamic require may fail at run time, because the requested file
is unknown at compilation time and not included into executable.
Use a string literal as an argument for 'require', or leave it
as is and specify the resolved file name in 'scripts' option.
Warning Cannot resolve 'path.resolve(filename)'
/usr/local/lib/node_modules/pm2/lib/Common.js
Dynamic require may fail at run time, because the requested file
is unknown at compilation time and not included into executable.
Use a string literal as an argument for 'require', or leave it
as is and specify the resolved file name in 'scripts' option.
Warning Cannot resolve 'package_file'
/usr/local/lib/node_modules/pm2/lib/API/Modules/NPM.js
Dynamic require may fail at run time, because the requested file
is unknown at compilation time and not included into executable.
Use a string literal as an argument for 'require', or leave it
as is and specify the resolved file name in 'scripts' option.
Warning Cannot resolve 'opts.cmd || opts.package'
/usr/local/lib/node_modules/pm2/lib/API/Modules/NPM.js
Dynamic require may fail at run time, because the requested file
is unknown at compilation time and not included into executable.
Use a string literal as an argument for 'require', or leave it
as is and specify the resolved file name in 'scripts' option.
Warning Cannot resolve 'path.join(module_path, 'package.json')'
/usr/local/lib/node_modules/pm2/lib/API/Modules/TAR.js
Dynamic require may fail at run time, because the requested file
is unknown at compilation time and not included into executable.
Use a string literal as an argument for 'require', or leave it
as is and specify the resolved file name in 'scripts' option.
./pm2
pkg/prelude/bootstrap.js:1185
throw error;
^
ReferenceError: source is not defined
at Object. (/snapshot/pm2/constants.js:1:63)
at Module.install.Module._compile (/snapshot/pm2/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (module.js:662:10)
at Module.load (module.js:564:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (module.js:595:17)
at Module.require (pkg/prelude/bootstrap.js:1166:31)
at require (internal/module.js:11:18)
at Object. (/snapshot/pm2/bin/pm2:0:0)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing constants.js and the bin/pm2 entry point, then reproduce the reported pkg command and its warnings. Check whether the repository documents a supported single-binary workflow; done means adding accurate packaging instructions or clearly documenting the limitation and required dependencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100