PM2 module installation should support other package managers
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
node -v # v24.20.0
pnpm -v # 12.3.1
npm -v # NOT FOUND — zsh: npm: 명령을 찾을 수 없습니다...
pm2 -v # 7.0.4
pm2 install pm2-logrotate
The error happens in /pm2/lib/API/Modules/NPM.js:
[PM2][Module] Calling [NPM] to install pm2-logrotate ...
node:child_process:585
validateString(file, 'file');
^
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received null
at normalizeSpawnArguments (node:child_process:585:3)
at spawn (node:child_process:806:13)
at /home/hyunbinseo/.local/share/pnpm/global/v11/525b6-18d2725b77324f18-0/node_modules/.pnpm/pm2@7.0.4_supports-color@7.2.0/node_modules/pm2/lib/API/Modules/NPM.js:216:74 {
code: 'ERR_INVALID_ARG_TYPE'
}
Node.js v24.20.0
npm might not exist in the system, so respecting the package manager used to install PM2 would be nice.
Installing a Node.js runtime via
node@runtime:<version>(includingpnpm env useandpnpm runtime set node) no longer extracts the bundlednpm,npx, andcorepackfrom the Node.js archive.
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 in /pm2/lib/API/Modules/NPM.js, especially the spawn call around line 216, and reproduce the reported pm2 install pm2-logrotate failure in an environment with pnpm but no npm. Trace how the package manager executable is selected; done means module installation works when npm is unavailable and uses the package manager available to PM2.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100