ci(publish): pin npm to 11.x so the publish job works on Node 20 - #207
Merged
Conversation
`npm install -g npm@latest` now resolves to npm 12.0.2, whose engine requirement is ^22.22.2 || ^24.15.0 || >=26.0.0. The publish job pins node-version: '20', so the step fails EBADENGINE before dependencies are installed, before tests, and before npm publish. This broke the v0.0.9 release (run 30540591005) and would break any tag pushed from today onward, regardless of what is being released. npm@11 is 11.19.0 with engines ^20.17.0 || >=22.9.0 — satisfied by the job's Node 20.20.2 and well past the 11.5.1 that trusted publishing needs. Pinning the major keeps patch updates flowing without another silent engine break. Bumping to Node 22 is the more future-proof fix, but the publish job also runs the full npm test, so that changes the runtime the release is validated against. #194 is already open for that upgrade. Closes #206 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #206.
Problem
The
v0.0.9tag push failed at theUpdate npmstep — run 30540591005 — before dependencies were installed, before tests, and beforenpm publish:npm@latesthas moved to 12.0.2, which dropped Node 20. The job pinsnode-version: '20', so the install is refused. Nothing was published — npm still shows only0.0.6.This is an upstream change, not a repo regression: it breaks any tag pushed from today onward.
Change
npm@11is currently 11.19.0, engines^20.17.0 || >=22.9.0— satisfied by the job's Node 20.20.2, and well past the 11.5.1 that trusted publishing / OIDC requires. Pinning the major keeps patch updates flowing without another silent engine break; the unqualifiedlatestis what made this a time bomb.Why not bump Node to 22
More future-proof, but wider: the publish job also runs the full
npm test, so changing its Node version changes the runtime the release is validated against. #194 (P1: Upgrade to graphql-yoga 5 and Node 22 LTS) is already open and is the right place for that. Once it lands, this pin can be revisited.Verification
This workflow only runs on
v*tag pushes andworkflow_dispatch, so PR CI cannot exercise it. The engine claim is checked directly against the registry:Node 20.20.2 satisfies
^20.17.0and does not satisfy^22.22.2, which is exactly the observed pass/fail split. Real proof comes from the retriggeredv0.0.9publish after this merges.Follow-up
v0.0.9is tagged at3d254f7but published nothing. Re-running the failed run will not help — a tag-push event uses the workflow file as it exists at the tagged commit, which still has the broken step. The tag needs to be moved to the commit containing this fix and re-pushed. Since no npm version was consumed, that is a clean operation.🤖 Generated with Claude Code