Repository navigation
Possible NodeJS 22.22.2 regression when installing latest NPM #62425
Copy link
Copy link
Closed
Closed
Copy link
Labels
npmIssues and PRs related to the npm client dependency or the npm registry.Issues and PRs related to the npm client dependency or the npm registry.v22.xIssues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.
Description
Version
v22.22.2
Platform
Darwin M-FC6WJYY430 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:56:35 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6030 arm64
Subsystem
No response
What steps will reproduce the bug?
# use the latest node 22.x
nvm install 22.22.2
# activate the node version
nvm use 22.22.2
# install latest npm
npm install -g npm@latestHow often does it reproduce? Is there a required condition?
Always happens.
What is the expected behavior? Why is that the expected behavior?
NPM should install successfully.
What do you see instead?
npm error code MODULE_NOT_FOUND
npm error Cannot find module 'promise-retry'
npm error Require stack:
npm error - /opt/hostedtoolcache/node/22.22.2/x64/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js
npm error - /opt/hostedtoolcache/node/22.22.2/x64/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/index.js
npm error - /opt/hostedtoolcache/node/22.22.2/x64/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/index.js
npm error - /opt/hostedtoolcache/node/22.22.2/x64/lib/node_modules/npm/node_modules/libnpmfund/lib/index.js
npm error - /opt/hostedtoolcache/node/22.22.2/x64/lib/node_modules/npm/lib/utils/reify-output.js
npm error - /opt/hostedtoolcache/node/22.22.2/x64/lib/node_modules/npm/lib/utils/reify-finish.js
npm error - /opt/hostedtoolcache/node/22.22.2/x64/lib/node_modules/npm/lib/commands/install.js
npm error - /opt/hostedtoolcache/node/22.22.2/x64/lib/node_modules/npm/lib/npm.js
npm error - /opt/hostedtoolcache/node/22.22.2/x64/lib/node_modules/npm/lib/cli/entry.js
npm error - /opt/hostedtoolcache/node/22.22.2/x64/lib/node_modules/npm/lib/cli.js
npm error - /opt/hostedtoolcache/node/22.22.2/x64/lib/node_modules/npm/bin/npm-cli.js
Additional information
Created a minimal reproducible matrix of Node and NPM versions in https://github.com/altbdoor/node-22-npm-regress/actions/runs/23525843427/job/68478996014 .
For brevity:
| Node | NPM | Success? |
|---|---|---|
22.22.1 |
^11.12.0 |
OK |
22.22.1 |
^11.11.0 |
OK |
22.22.1 |
latest |
OK |
22.22.2 |
^11.12.0 |
NOK |
22.22.2 |
^11.11.0 |
NOK |
22.22.2 |
latest |
NOK |
Edit: seems to only happen from a new Node 22.22.2 environment, doing npm install -g npm@latest. Installing the versions in increment appears to be OK.
$ npm i -g npm@^10
changed 13 packages in 1s
$ npm i -g npm@~11.10
removed 48 packages, and changed 92 packages in 1s
$ npm i -g npm@~11.11
removed 1 package, and changed 26 packages in 902ms
$ npm i -g npm@~11.12
removed 7 packages, and changed 22 packages in 905ms
$ npm i -g npm@latest
changed 10 packages in 1sReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
npmIssues and PRs related to the npm client dependency or the npm registry.Issues and PRs related to the npm client dependency or the npm registry.v22.xIssues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.
Activity
MikeMcC399 commentedon Mar 25, 2026
Also reproducible on Ubuntu 24.04.4 LTS and only on Node.js 22.22.2. Other security releases (20.20.2, 24.14.1 & 25.8.2) are not affected.
Possibly this should also be reported to https://github.com/npm/cli/issues
tiagosiebler commentedon Mar 25, 2026
Easily reproducible in ubuntu latest running in a container (#62430) and on Mac Sequoia after nvm switch to v22.22.2
fix(sysupgrade): disable nvm/npm upgrade due to node v22.22.2 regression
ctataryn-qh commentedon Mar 25, 2026
Same problem for me when running
npm i -g npmMikeMcC399 commentedon Mar 25, 2026
Also reported in npm/cli#9151
fix(tools.func): pin npm to 11.11.0 to work around Node.js 22.22.2 re…
fix(tools.func): pin npm to 11.11.0 to work around Node.js 22.22.2 re…
fix: eagerly require promise-retry to survive self-upgrade
MikeMcC399 commentedon Mar 26, 2026
fix: eagerly require promise-retry to survive self-upgrade
owlstronaut commentedon Mar 27, 2026
#62463. Tested locally myself but would love to hear from others once it's released
altbdoor commentedon Mar 27, 2026
@owlstronaut I manually updated NPM in Node 22.22.2 to the new version, and it works.
Pin npm to fix build for Laravel
timtrense-leadec commentedon Mar 31, 2026
Reproducible as a oneliner via
docker run --rm -it --entrypoint bash node:22-bookworm -c "npm i -g npm@latest"Our CI pipeline logs confirm that the issue was not present at
2026-03-24 09:36 UTC.I can confirm that first installing a non-latest version works, like @altbdoor said:
docker run --rm -it --entrypoint bash node:22-bookworm -c "npm i -g npm@10.9.8 && npm i -g npm@latest"--> Successful104 remaining items
ci: pin Node to 22.22.3 to avoid 22.22.2 npm toolcache regression
ci: bump pinned Node to 22.22.2 to fix npm@latest EBADENGINE (#246)
ci(publish): move publish job to Node 24 to fix npm publish failure
Unpin Node in publish job
Unpin the publish job Node version and refresh the lockfile
Build: (998c20a) Unpin the publish job Node version and refresh the l…
fix(ci): unpin Node in publish workflow
Release/8.3.1 (#145)
fix(build): move Node pin to 24.15.0; 22.22.2 ships a broken npm
Pin `npm` to version to prevent npm issues from breaking the build
Pin `npm` to version to prevent npm issues from breaking the build
Pin `npm` to version to prevent npm issues from breaking the build
fix(ci): pin npm to 11.11.0 to avoid self-upgrade regression
Say what the npm 10.9.7 block is actually for
Silence npm's update notice so the real error stays visible (#16)