Skip to content

PM2 module installation should support other package managers #6150

Open

Description

@hyunbinseo
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> (including pnpm env use and pnpm runtime set node) no longer extracts the bundled npm, npx, and corepack from the Node.js archive.

https://pnpm.io/blog/releases/11.0#slimmer-runtime-installs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions