Verify latest release
pnpm version
11.5.2
Which area(s) of pnpm are affected? (leave empty if unsure)
self-upgrade
Reproduction steps
- Open a terminal in any directory that does not have a
package.json (e.g. the user's home directory ~)
- Run
pnpm self-upgrade
Describe the Bug
pnpm self-upgrade fails with ERR_PNPM_NO_PKG_MANIFEST when executed from a directory that does not contain a package.json.
[ERR_PNPM_NO_PKG_MANIFEST] No package.json found in /Users/htkim
[ERROR] Command failed with exit code 1: node .../pnpm.mjs install
Looking at the stack trace, self-upgrade internally triggers runDepsStatusCheck, which calls pnpm install in the current working directory. Since there is no package.json in the home directory, it fails.
at runDepsStatusCheck (pnpm.mjs:220133)
at runPnpmCli (pnpm.mjs:218401)
at spawnSubprocessSync (pnpm.mjs:38200)
self-upgrade should not require a package.json in the current directory — it is upgrading the pnpm binary itself, not a project's dependencies.
Workaround
Use npm install -g pnpm@latest instead.
Expected Behavior
pnpm self-upgrade completes successfully regardless of the current working directory.
Which Node.js version are you using?
v22.17.1
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
macOS 26.4.1 (Darwin 25.4.0)
Related issues
Verify latest release
pnpm version
11.5.2
Which area(s) of pnpm are affected? (leave empty if unsure)
self-upgrade
Reproduction steps
package.json(e.g. the user's home directory~)pnpm self-upgradeDescribe the Bug
pnpm self-upgradefails withERR_PNPM_NO_PKG_MANIFESTwhen executed from a directory that does not contain apackage.json.Looking at the stack trace,
self-upgradeinternally triggersrunDepsStatusCheck, which callspnpm installin the current working directory. Since there is nopackage.jsonin the home directory, it fails.self-upgradeshould not require apackage.jsonin the current directory — it is upgrading the pnpm binary itself, not a project's dependencies.Workaround
Use
npm install -g pnpm@latestinstead.Expected Behavior
pnpm self-upgradecompletes successfully regardless of the current working directory.Which Node.js version are you using?
v22.17.1
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
macOS 26.4.1 (Darwin 25.4.0)
Related issues
pnpm-workspace.yaml