Skip to content

fix(ci): pin npm to 11.6.2 so publish-npm runs on Node 20#70

Merged
mikemilla merged 1 commit into
mainfrom
mike/fix-npm-publish-node-engine
Jul 10, 2026
Merged

fix(ci): pin npm to 11.6.2 so publish-npm runs on Node 20#70
mikemilla merged 1 commit into
mainfrom
mike/fix-npm-publish-node-engine

Conversation

@mikemilla

Copy link
Copy Markdown
Contributor

Problem

The publish-npm job in publish-release.yml runs npm install -g npm@latest on a Node 20 runner. npm@latest is now 12.0.0, which requires Node ≥22, so the step fails with EBADENGINE:

npm error notsup Required: {"node":"^22.22.2 || ^24.15.0 || >=26.0.0"}
npm error notsup Actual:   {"npm":"10.8.2","node":"v20.20.2"}

Result: the Go binaries + GitHub release publish fine via goreleaser, but @trycourier/cli never reaches npm — it's stuck at 3.10.1 while releases marched to 3.11.1.

Fix

Pin npm to 11.6.2 — the newest line that still supports Node 20 (engines: node ^20.17.0 || >=22) while keeping OIDC trusted publishing (added in npm 11.5.1). Mirrors courier-node's working publish path. One-line change.

Follow-up

The npm step is upgraded specifically because Node 20's bundled npm (10.8.2) lacks OIDC trusted publishing. A more future-proof alternative is bumping the runner to Node 22 + npm@latest; pinning is the minimal, proven fix for now.

🤖 Generated with Claude Code

The publish-npm job runs `npm install -g npm@latest` on a Node 20 runner.
npm@latest is now 12.0.0, which requires Node >=22, so the step fails with
EBADENGINE and @trycourier/cli never publishes (stuck at 3.10.1 while the
Go binaries/GitHub release ship fine via goreleaser).

Pin npm to 11.6.2 — the newest line that still supports Node 20
(engines: node ^20.17.0 || >=22) while retaining OIDC trusted publishing
support (added in npm 11.5.1). This mirrors what courier-node's publish
path uses.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mikemilla mikemilla merged commit 42dd6b1 into main Jul 10, 2026
7 checks passed
@mikemilla mikemilla deleted the mike/fix-npm-publish-node-engine branch July 10, 2026 00:31
@stainless-app stainless-app Bot mentioned this pull request Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant