Skip to content

Publish on a Node that npm supports - #216

Merged
paul-paliychuk merged 1 commit into
mainfrom
fix/npm-publish-node-24
Aug 25, 2026
Merged

Publish on a Node that npm supports#216
paul-paliychuk merged 1 commit into
mainfrom
fix/npm-publish-node-24

Conversation

@paul-paliychuk

Copy link
Copy Markdown
Contributor

npx -y npm@latest now resolves npm 12, which requires Node ^22.22.2 || ^24.15.0 || >=26. This job pins Node 20, so npm refuses to run, the trusted-publishing OIDC exchange never happens, and publish fails:

npm warn cli npm v12.0.2 does not support Node.js v20.20.2.
This version of npm supports the following node versions:
`^22.22.2 || ^24.15.0 || >=26.0.0`
...
npm error code ENEEDAUTH
npm error need auth This command requires you to be logged in to https://registry.npmjs.org/

Nothing in this repo changed. 3.28.0 published fine because npm@latest still supported Node 20 then. npm moved, and the next v3 release would fail this way. We hit it for real on the v4 branch while publishing 4.0.0-alpha.1 — same workflow, same pairing — which is how it surfaced.

Scope

Only the Node version moves. This branch's package.json still carries "prepack": "yarn build", so npm publish keeps building on its way out, and the yarn install path is untouched. (The v4 branch additionally needed an explicit build step, because the v4 generator emits no prepack — not applicable here.)

Worth considering separately

npx -y npm@latest tracks whatever npm ships. Pinning a known-good npm would stop a future npm major breaking publishing again, but that's a deliberate choice rather than part of this fix.

npx -y npm@latest now resolves npm 12, which requires Node
^22.22.2 || ^24.15.0 || >=26. This job pins Node 20, so npm refuses to run,
the trusted-publishing OIDC exchange never happens, and publish fails with
ENEEDAUTH.

Nothing here changed: 3.28.0 published because npm@latest still supported
Node 20 at the time. npm moved, and the next release on this branch would
fail. The v4 branch hit exactly this while publishing 4.0.0-alpha.1.

Only the Node version moves. This branch's package.json still carries
"prepack": "yarn build", so npm publish continues to build on its way out,
and the yarn install path is untouched.
@paul-paliychuk
paul-paliychuk merged commit f26c702 into main Aug 25, 2026
6 checks passed
@paul-paliychuk
paul-paliychuk deleted the fix/npm-publish-node-24 branch August 25, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant