Skip to content

fix: enable npm OIDC trusted publishing#1042

Merged
sarahdayan merged 3 commits into
mainfrom
fix/npm-oidc-version
Feb 5, 2026
Merged

fix: enable npm OIDC trusted publishing#1042
sarahdayan merged 3 commits into
mainfrom
fix/npm-oidc-version

Conversation

@sarahdayan

@sarahdayan sarahdayan commented Feb 5, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the ENEEDAUTH error when publishing with useOidcTokenProvider: true.

Problem

The release workflow failed with:

npm error code ENEEDAUTH
npm error need auth This command requires you to be logged in to https://registry.npmjs.org/

This happened because npm OIDC trusted publishing has two requirements that weren't being met:

  1. npm CLI v11.5.1+ is required for OIDC authentication. Node 20 bundles npm 10, which doesn't support trusted publishing.

  2. The --provenance flag is needed by some users for OIDC publishing to work, even though npm docs say it should be automatic.

Solution

  1. Workflow change: Add npm install -g npm@latest step before publishing to upgrade to npm 11.5+

  2. Ship.js change: Add --provenance flag to npm publish command when useOidcTokenProvider is enabled

References

sarahdayan and others added 3 commits February 5, 2026 11:29
npm OIDC trusted publishing requires npm v11.5+, but Node 20 bundles
npm 10. This adds an npm upgrade step before publishing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Some npm registries require the --provenance flag even with OIDC
trusted publishing. Pass useOidcTokenProvider to getPublishCommand
and add the flag when enabled.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
OIDC trusted publishing requires npm v11.5.1 or later.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sarahdayan sarahdayan requested review from a team, FabienMotte and aymeric-giraudet and removed request for a team February 5, 2026 10:41
@sarahdayan sarahdayan requested a review from Haroenv February 5, 2026 10:58
@sarahdayan sarahdayan merged commit 70b8b80 into main Feb 5, 2026
7 checks passed
@sarahdayan sarahdayan deleted the fix/npm-oidc-version branch February 5, 2026 11:27
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.

2 participants