ci: publish on Node 24 with a pinned npm - #153
Conversation
The publish job ran on Node 25 and then ran `npm install -g npm@latest`.
npm 12 requires Node `^22.22.2 || ^24.15.0 || >=26.0.0`, which excludes
Node 25, so once npm 12 shipped that step died with EBADENGINE and the
package could no longer be published:
npm error code EBADENGINE
npm error Not compatible with your version of node/npm: npm@12.0.2
npm error Required: {"node":"^22.22.2 || ^24.15.0 || >=26.0.0"}
npm error Actual: {"node":"v25.9.0","npm":"11.12.1"}
Move the job to Node 24 (an LTS line every npm 11.x and 12.x supports)
and pin the upgrade to `npm@^11.5.1` — a range rather than `@latest`, so
the next npm major dropping this Node line cannot silently break
publishing again. npm >= 11.5.1 is what OIDC trusted publishing needs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013S4pYSjwUsiZtdtMMpW7bw
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoFix npm publishing with Node 24 and pinned npm 11
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Publishing regressions go undetected
|
| node-version: 24 | ||
| registry-url: https://registry.npmjs.org/ | ||
| # Pinned to a range rather than @latest: the next npm major dropping | ||
| # this Node line would silently break publishing fleet-wide again. | ||
| - name: Upgrade npm to >=11.5.1 (required for trusted publishing) | ||
| run: npm install -g npm@latest | ||
| run: npm install -g npm@^11.5.1 |
There was a problem hiding this comment.
1. Publishing regressions go undetected 📘 Rule violation ▣ Testability
.github/workflows/npmpublish.yml changes the previously failing publish environment to Node 24 and npm@^11.5.1, but the change set adds no automated regression test for that compatibility constraint. A future runtime or npm-range edit can reintroduce the EBADENGINE scenario without the normal test suite catching it before the publish job runs.
Agent Prompt
## Issue description
The publish workflow fixes an npm and Node compatibility failure without adding an automated regression test that protects the required version relationship.
## Fix Focus Areas
- .github/workflows/npmpublish.yml[23-33]
## Recommended Fix
Add a test wired into the normal test suite that reads the publish workflow and asserts it selects the supported Node 24 line and constrains the npm upgrade to major version 11 at or above 11.5.1. Ensure the test fails for the former Node 25 and `npm@latest` combination.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The publish job ran on Node 25 and then ran
npm install -g npm@latest. npm 12 requires Node^22.22.2 || ^24.15.0 || >=26.0.0, which excludes Node 25, so once npm 12 shipped that step died with EBADENGINE and this package could no longer be published:This moves the job to Node 24 (an LTS line every npm 11.x and 12.x supports) and pins the upgrade to
npm@^11.5.1— a range rather than@latest, so the next npm major dropping this Node line cannot silently break publishing fleet-wide again. npm >= 11.5.1 is what OIDC trusted publishing needs.Same fix as the pilot, ether/ep_align#227.
🤖 Generated with Claude Code
https://claude.ai/code/session_013S4pYSjwUsiZtdtMMpW7bw