Skip to content

ci(release-core): upgrade Node to 24 LTS (real fix for npm OIDC 404)#18

Merged
Roy-Kid merged 1 commit into
MolCrafts:masterfrom
Roy-Kid:fix/release-core-node-24
Apr 20, 2026
Merged

ci(release-core): upgrade Node to 24 LTS (real fix for npm OIDC 404)#18
Roy-Kid merged 1 commit into
MolCrafts:masterfrom
Roy-Kid:fix/release-core-node-24

Conversation

@Roy-Kid
Copy link
Copy Markdown
Contributor

@Roy-Kid Roy-Kid commented Apr 20, 2026

Why

PR #17 replaced `npm install -g npm@latest` with `corepack enable && corepack prepare npm@11.5.1 --activate`. Corepack said it was preparing npm 11.5.1 — but in run 24663169282 the subsequent `npm --version` still reported 10.9.7. `corepack enable` only shims yarn and pnpm by default; npm is special-cased and `prepare --activate` does not swap the PATH. So `npm publish` was still running the 10.9.7 bundled with Node 22, which cannot complete the OIDC Trusted Publishing registry-side handshake. The registry treats the request as anonymous and returns a misleading `404 "is not in this registry"` on PUT.

Documented in this Medium post — the title literally says "The Weird 404 Error and the Node.js 24 Fix".

The fix

Upgrade to Node 24 LTS, which ships with npm 11.5+ natively. Drop the corepack step and the `npm install -g` step entirely — not needed. This also avoids the unrelated Node 22.22.2 hostedtoolcache regression (missing `promise-retry`) that failed the original v0.0.4 publish.

Test plan

  • After merge: `gh workflow run release-core.yml --repo MolCrafts/molvis --ref master`
  • Verify `@molcrafts/molvis-core@0.0.4` on npm with `npm view @molcrafts/molvis-core@0.0.4`

Node 24 LTS ships with npm 11.5+ natively. npm 11.5+ is the minimum that
supports OIDC Trusted Publishing's registry-side handshake — npm 10.9.7
(bundled with Node 22) fails the handshake silently and the registry
returns a misleading `404 "is not in this registry"` on PUT, as seen in
run 24663169282.

The previous corepack-based fix printed "Preparing npm@11.5.1 for
immediate activation" but did not actually switch npm — the subsequent
`npm --version` still reported 10.9.7. `corepack enable` only shims
yarn/pnpm by default; npm is special-cased and `prepare --activate`
doesn't swap the PATH. Rather than patch around that, moving to Node 24
makes it moot: npm 11.5+ is the shipped version, no extra step needed.

This also sidesteps the unrelated Node 22.22.2 hostedtoolcache bug
(missing `promise-retry` in the shipped npm's arborist) that bit us
earlier.
@Roy-Kid Roy-Kid merged commit 4ab4bb5 into MolCrafts:master Apr 20, 2026
5 checks passed
@Roy-Kid Roy-Kid deleted the fix/release-core-node-24 branch April 20, 2026 11:53
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