Yarn: Cannot authenticate in npm registry using _authToken

Created on 17 Mar 2019  路  1Comment  路  Source: yarnpkg/yarn

Hello.

I am trying to publish a package to npm registry using "yarn publish" command, from Circle CI.
I have an Auth token for the NPM registry but I am not sure how to set it in yarn.

I tried

yarn config set //registry.yarnpkg.com/:_authToken $NPM_TOKEN
yarn publish --non-interactive

But I get the following error:

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.

What I am missing?

Thank you.

Most helpful comment

In CircleCI you can try something like:

command: echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >>~/.npmrc

>All comments

In CircleCI you can try something like:

command: echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >>~/.npmrc
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fishrock123 picture Fishrock123  路  103Comments

donaldpipowitch picture donaldpipowitch  路  75Comments

sfabriece picture sfabriece  路  73Comments

fahrradflucht picture fahrradflucht  路  120Comments

indieisaconcept picture indieisaconcept  路  90Comments