File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,8 +188,16 @@ jobs:
188188
189189 # Trusted publishing requires npm >=11.5.1 for OIDC token exchange.
190190 # Pin to ^11.5.1 so we don't silently get an older 11.x that lacks OIDC.
191+ #
192+ # Bootstrap via `npx` rather than `npm install -g npm@...` — the latter
193+ # hits a long-standing npm self-upgrade bug (reproduces on github-hosted
194+ # runners too) where mid-reify npm unlinks its own `promise-retry` dep
195+ # and dies with MODULE_NOT_FOUND. Using a fresh npx-fetched npm to
196+ # install itself globally sidesteps the half-upgraded state entirely.
191197 - name : Upgrade npm for trusted publishing
192- run : npm install -g npm@^11.5.1 && npm --version
198+ run : |
199+ npx --yes npm@^11.5.1 install -g --force npm@^11.5.1
200+ npm --version
193201
194202 - name : Download npm tarball
195203 uses : actions/download-artifact@v8
You can’t perform that action at this time.
0 commit comments