No token found and can't prompt for login when running with --non-interactive.

See original GitHub issue

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:

image

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!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:17
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

20reactions
leadreamcommented, Nov 7, 2019

Yarn requires always-auth to authorize, NPM tends to ignore this. Add it like this:

      - uses: actions/setup-node@v1
        with:
          always-auth: true

Still don’t work for me, but adding this line in below works.

- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
16reactions
echoulencommented, Mar 14, 2021

NPM_AUTH_TOKEN work for npm registry NODE_AUTH_TOKEN work for scope registry

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I login to yarn non-interactively? - Stack Overflow
In interactive mode, I can successfully run: $ yarn login yarn login v0.21.3 question npm username: jesstelford question npm email: example ...
Read more >
Yarn publish does not work (#121668) · Issues - GitLab
A yarn publish fails with a 404 when attempting to publish a package to the NPM registry. This looks it may be more...
Read more >
Login and Logout - DNAnexus Documentation
You can log in without having to provide a username and password for a certain amount of time by using authentication tokens (henceforth...
Read more >
Acquire a token to call a web API using username and ...
The username and password flow isn't compatible with conditional access and multi-factor authentication. As a consequence, if your app runs in ...
Read more >
login - Command | Vault - HashiCorp Developer
A successful authentication results in a Vault token - conceptually similar to a session token on a website. ... You do NOT need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found