Skip to content

Commit a4e2f1e

Browse files
mishushakovclaude
andcommitted
Fix Release workflow by installing npm via tarball
The pre-installed npm 10.9.x on the Node 22 runner image ships with a broken @npmcli/arborist (missing promise-retry), which makes `npm install -g npm@11` crash during reify. Replace npm via a tarball extract so the Update npm step can succeed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6d54054 commit a4e2f1e

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,16 @@ jobs:
344344
pnpm config set exclude-links-from-lockfile true
345345
346346
- name: Update npm
347+
# Workaround: the pre-installed npm on the Node 22 runner image ships
348+
# with a broken @npmcli/arborist (missing promise-retry), so `npm
349+
# install -g npm@11` fails during reify. Replace npm via tarball.
350+
# npm 11+ is required for OIDC trusted publishing (NPM_TOKEN="").
347351
run: |
348-
npm install -g npm@^11.6
352+
NPM_VERSION="11.9.0"
353+
NPM_DIR="$(dirname "$(dirname "$(which node)")")/lib/node_modules/npm"
354+
sudo rm -rf "${NPM_DIR}"
355+
sudo mkdir -p "${NPM_DIR}"
356+
curl -fsSL "https://registry.npmjs.org/npm/-/npm-${NPM_VERSION}.tgz" | sudo tar -xz -C "${NPM_DIR}" --strip-components=1
349357
npm --version
350358
351359
- name: Install dependencies

0 commit comments

Comments
 (0)