Skip to content

Commit 0f5b084

Browse files
DavertMikclaude
andcommitted
ci: drop npm install -g npm@latest — fails under Node 22.22+
Run 24361722242 (v0.2.0 release) failed at the "Install latest npm" step with a MODULE_NOT_FOUND error for `promise-retry` inside @npmcli/arborist/lib/arborist/rebuild.js. Same bug hits main codeceptjs/publish-beta.yml on the same Node 22.22.2 runner (run 24115715943, 4.0.0-rc.12). Root cause: a regression in how `npm install -g npm@latest` re-enters arborist when the user's local project already has node_modules. The step is cosmetic for us — Node 22 bundles npm 10.9+, and --provenance has shipped since npm 9.5, so there's no functional reason to force a global reinstall on every publish. Fix: remove the step. If a future feature ever needs a newer npm, pin to a specific known-good version (e.g. npm@11) rather than @latest. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3f135b9 commit 0f5b084

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ jobs:
3939
- name: Install dependencies
4040
run: npm install
4141

42-
# Upgrade npm to the latest version — provenance support improves with
43-
# every release and we want the most up-to-date signer on every publish.
44-
- name: Install latest npm
45-
run: npm install -g npm@latest
42+
# NOTE: we intentionally do NOT run `npm install -g npm@latest` here.
43+
# Under Node 22.22+ that step hits a known arborist regression
44+
# (`Cannot find module 'promise-retry'`) that breaks the publish.
45+
# Node 22 already ships with npm >= 10.9, and npm has supported
46+
# --provenance since 9.5, so the upgrade was cosmetic.
4647

4748
- name: Typecheck
4849
run: npm run typecheck
@@ -69,7 +70,7 @@ jobs:
6970
echo "tag=latest" >> "$GITHUB_OUTPUT"
7071
fi
7172
72-
# `--provenance` requires npm >= 9.5.0 (we installed latest above).
73+
# `--provenance` requires npm >= 9.5.0; Node 22's bundled npm is 10.9+.
7374
# Auth uses npm trusted publishing via OIDC (id-token: write above) —
7475
# no NPM_TOKEN secret needed. The published package gets a provenance
7576
# statement linking it to this workflow run at github.com/codeceptjs/reflection.

0 commit comments

Comments
 (0)