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.
In CircleCI you can try something like:
command: echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >>~/.npmrc
Most helpful comment
In CircleCI you can try something like: