Skip to content

Commit 11204ae

Browse files
authored
fix npm install (#79)
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
1 parent 1a7e37e commit 11204ae

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)