NPM trusted publishing fails: Access token expired or revoked. Please try logging in again. #188194
Unanswered
MaddyGuthridge
asked this question in
npm
Replies: 1 comment
-
|
With trusted publishing, GitHub uses OIDC to authenticate automatically, so no token is needed in the workflow. The error usually means the repository hasn't been properly linked in the npm package settings. Go to your npm package → Settings → GitHub → connect repository and enable Allow GitHub Actions. Also ensure your workflow has: permissions: packages: write (or contents: write). Use npm@^9. Provenance can cause issues; try adding --provenance=false or upgrade to npm@latest. After linking, the error should resolve. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
I've been trying for the past 2 hours to convince my
npm publishworkflow to operate correctly, but it simply fails to work with every change I have tried. I have:npm i -g npm@^11.5.1Despite all of this, the workflow fails, stating:
Access token expired or revoked. Please try logging in again.This error makes no sense, because I am not using an access token at all, and this (brand new) repository never had one configured. Isn't the whole point of trusted publishing that I don't need to log in with a token?
For reference:
This has been an incredibly frustrating experience. Any suggestions are appreciated.
Beta Was this translation helpful? Give feedback.
All reactions