PM2 module installation should support other package managers
Author: hyunbinseoCreated Sep 5, 2026Updated Sep 5, 2026
node -v # v24.20.0
pnpm -v # 12.3.1
npm -v # NOT FOUND — zsh: npm: 명령을 찾을 수 없습니다...
pm2 -v # 7.0.4
pm2 install pm2-logrotateThe 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/[email protected][email protected]/node_modules/pm2/lib/API/Modules/NPM.js:216:74 {
code: 'ERR_INVALID_ARG_TYPE'
}
Node.js v24.20.0npm 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.
Source: Unitech/pm2