Skip to content

Commit 330c5a6

Browse files
authored
fix npm publish (#76)
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
1 parent 616df06 commit 330c5a6

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
@@ -132,8 +132,16 @@ jobs:
132132

133133
# Trusted publishing requires npm >=11.5.1 for OIDC token exchange.
134134
# Pin to ^11.5.1 so we don't silently get an older 11.x that lacks OIDC.
135+
#
136+
# Bootstrap via `npx` rather than `npm install -g npm@...` — the latter
137+
# hits a long-standing npm self-upgrade bug on self-hosted runners where
138+
# mid-reify npm unlinks its own `promise-retry` dep and dies with
139+
# MODULE_NOT_FOUND. Using a fresh npx-fetched npm to install itself
140+
# globally sidesteps the half-upgraded state entirely.
135141
- name: Upgrade npm for trusted publishing
136-
run: npm install -g npm@^11.5.1 && npm --version
142+
run: |
143+
npx --yes npm@^11.5.1 install -g --force npm@^11.5.1
144+
npm --version
137145
138146
- uses: hyperlight-dev/ci-setup-workflow@v1.9.0
139147
with:

0 commit comments

Comments
 (0)