Skip to content

Commit f855b93

Browse files
chore: work around Node.js 22 / npm issue (#352)
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 can avoid the problem altogether by removing the `npm install -g@latest` step. It was initially added because it was needed for Trusted Publishing at the time, but nowadays the bundled npm is modern enough that we don’t need to force the latest version anymore.
1 parent 50bb580 commit f855b93

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ jobs:
1919
with:
2020
node-version-file: '.nvmrc'
2121
registry-url: 'https://registry.npmjs.org'
22-
- name: Update npm
23-
run: npm install -g npm@latest
2422
- name: Publish
2523
run: |
2624
npm publish --provenance --access public

0 commit comments

Comments
 (0)