npm Trusted Publishing 404 errors often stem from outdated npm version, not registry issues
npm is phasing out 2FA-bypass automation tokens, replacing them with OIDC Trusted Publishing, which uses short-lived tokens tied to a registered GitHub repository and workflow. A developer migrating to the new system encountered repeated 404 errors during publishing, with error messages that pointed away from the actual cause. The root issue was that Node 20's bundled npm version (10.8.2) predates OIDC Trusted Publishing support, which only arrived in npm 11.5.1. Two misleading signals complicated debugging: successful provenance signing via sigstore falsely suggested OIDC was working, and a dummy credential string written by actions/setup-node@v4 resembled a masked secret. The fix requires explicitly upgrading npm to version 11.5.1 or later within the workflow, regardless of the Node.js version in use.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in