setup-node: No token found and can't prompt for login when running with --non-interactive.
In my repo I have the workflow like this:
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
I’ve added NPM_AUTH_TOKEN
to secrets, but got this error:
Run yarn publish
yarn publish
shell: /bin/bash -e {0}
env:
NODE_AUTH_TOKEN: ***
yarn publish v1.19.1
[1/4] Bumping version...
info Current version: 0.1.22
[2/4] Logging in...
error No token found and can't prompt for login when running with --non-interactive.
info Visit https://yarnpkg.com/en/docs/cli/publish for documentation about this command.
##[error]Process completed with exit code 1.
I have tried many times and can’t figure it out. My repo is https://github.com/leadream/juuust-icon. Can anyone help me? Thanks!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 19
- Comments: 21 (2 by maintainers)
Commits related to this issue
- Try to fix yarn publish As per https://github.com/actions/setup-node/issues/81 — committed to comit-network/create-comit-app by deleted user 5 years ago
- Try to fix yarn publish #2 As per https://github.com/actions/setup-node/issues/81 — committed to comit-network/create-comit-app by deleted user 5 years ago
- Fix yarn not reading auth token https://github.com/actions/setup-node/issues/81 — committed to lmc-eu/lmc-maps-js by OndraM 4 years ago
- Fix yarn not reading auth token https://github.com/actions/setup-node/issues/81 — committed to lmc-eu/lmc-maps-js by OndraM 4 years ago
- Add fix from actions/setup-node#81 to get publish working — committed to gagbo/goingnative by gagbo 4 years ago
- actions/setup-node#81 — committed to helder/std by benmerckx 4 years ago
- publish: actions/setup-node#81 generated from commit da0680ff8db5e2e8d96b2ebabcb169035d027748 — committed to helder/std by deleted user 4 years ago
- try to fix publish issue vis-a-vis https://github.com/actions/setup-node/issues/81 — committed to Zemnmez/do-sync by Zemnmez 3 years ago
- npm auth token (#22) * try to fix publish issue vis-a-vis https://github.com/actions/setup-node/issues/81 — committed to Zemnmez/do-sync by Zemnmez 3 years ago
- chore: try using NPM_AUTH_TOKEN instead of NODE_AUTH_TOKEN Attempt to fix the release workflow. See https://github.com/actions/setup-node/issues/81 — committed to meshcloud/notion-markdown-cms by JohannesRudolph 3 years ago
- add registry https://github.com/actions/setup-node/issues/81 — committed to tiltshift/config by chrisdrackett 2 years ago
- Chore(ci): Set NPM_AUTH_TOKEN for npm registry * @see https://github.com/actions/setup-node/issues/81 — committed to lmc-eu/jobs-design-system by literat 2 years ago
- Chore(ci): Set NPM_AUTH_TOKEN for npm registry * @see https://github.com/actions/setup-node/issues/81 — committed to lmc-eu/jobs-design-system by literat 2 years ago
- add registry https://github.com/actions/setup-node/issues/81 — committed to tiltshift/config by chrisdrackett 2 years ago
- Sets up always-auth true https://github.com/actions/setup-node/issues/81 — committed to TrickingApi/tricking-ts by mantism a year ago
- Merge pull request #81 from akamai/connector-update Connector update — committed to krzyk/setup-node by krzyk 3 years ago
- Try to fix always-auth https://github.com/actions/setup-node/issues/81 — committed to SeriousBug/live-limit by SeriousBug a year ago
- chore(deps-dev): bump typescript from 4.0.2 to 4.0.5 (#81) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.0.2 to 4.0.5. - [Release notes](https://github.com/Microsoft/TypeScript/... — committed to deining/setup-node by dependabot[bot] 4 years ago
- Attempted GHA fixups based on actions/setup-node#81 — committed to stellar/js-xdr by Shaptic 7 months ago
- Attempted GHA fixups based on actions/setup-node#81 (#112) — committed to stellar/js-xdr by Shaptic 7 months ago
Still don’t work for me, but adding this line in below works.
NPM_AUTH_TOKEN
work for npm registryNODE_AUTH_TOKEN
work for scope registryFor me I just need to supply the following:
https://help.github.com/en/actions/language-and-framework-guides/publishing-nodejs-packages
This sets the always-auth automatically, as well as the registry and scope etc.
sorry for the questions if is stupid, but why the env in all the example is called
NODE_AUTH_TOKEN
and noNPM_AUTH_TOKEN
?I use
NPM_AUTH_TOKEN
and works good for meOMG thank you - I’ve been trying every example I can find and getting nowhere. Tried
NPM_AUTH_TOKEN
instead and boom. Success.You may wanna check your the log in the actions to ensure the token isn’t getting logged in there. I’m not sure if github scrubs secrets from the log output or not. If they are scrubbing the output, then it should be all good. I didn’t feel like testing it out.
I brought it in as an environment variable so it is evaluated in the shell rather than before sending to the shell.
And the result is the logged output just shows the name of the environment variable.
Hi,
I have the same issue. One repo it works: https://github.com/comit-network/comit-js-sdk/ but then the same config does not work on a different repo: https://github.com/comit-network/create-comit-app/pull/243/checks?check_run_id=330403347
Is the solution above the official one or should we follow up with yarn to fix it?
@CSFlorin thanks for posting a link to your file, I figured by now you could have solved the problem, I copied your publish steps and it just works, so thanks!
Hello everyone. I’m going to close the issue, because the documentation was updated after releasing tag v2. If you have any concerns feel free to create a separate issue or pull request with updating documentation.
Hello @luxalpa. Actually you can use @ndthanhdev solution with bash, because this solution does not involve any powershell specific commands.
I’ve tried all the solutions above and none seems to work for me. Here are the various runs. And I have my npm token:
And here is the action file. Anyone have an idea?