Skip to content

Commit 350bc4d

Browse files
chore: work around Node.js 22 / npm issue
This patch temporarily adds an extra `npm install -g npm` to ensure an incremental upgrade, since direct upgrades to `npm@latest` are broken in npm 10.9.7 (which is bundled with Node.js 22.22.2). Running `npm install -g npm@latest` on Node.js 22.22.2 (which bundles npm 10.9.7) fails with `MODULE_NOT_FOUND: promise-retry`. This happens because npm 11.12.0 removed `promise-retry` from its bundle (in favor of `@gar/promise-retry`). During the self-upgrade, the reify step deletes `promise-retry` from disk, and then the still-running 10.x process hits a lazy `require('promise-retry')` in `_linkBins` and blows up. The root cause has already been fixed upstream (npm/cli#9152) and released on npm 10.9.8. However, we still need the workaround until a Node.js 22 patch release ships with npm ≥ 10.9.8.
1 parent 50bb580 commit 350bc4d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/publish-on-tag.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
node-version-file: '.nvmrc'
2121
registry-url: 'https://registry.npmjs.org'
2222
- name: Update npm
23-
run: npm install -g npm@latest
23+
run: |
24+
npm install -g npm@~11.10.0 # Workaround for https://github.com/npm/cli/issues/9151.
25+
npm install -g npm@latest
2426
- name: Publish
2527
run: |
2628
npm publish --provenance --access public

0 commit comments

Comments
 (0)