confused about .yarnrc and .npmrc

Viewed 20272

I have a private npm registry and a .npmrc file in the root directory of my project like this

_auth=${NPM_TOKEN}
always-auth=true
email=example@gmail.com
registry=https://example.com/artifactory/api/npm/

But I use yarn install to install the packages. Now, I am confused.

Should I create a .yarnrc file? If so, how can I convert .npmrc above to .yarnrc? Didn't find configurations such as _auth, always-auth in https://classic.yarnpkg.com/en/docs/yarnrc/

yarn installs packages from https://registry.yarnpkg.com, npm installs packages from https://registry.npmjs.org/. They have different registries. I am not sure yarn can installs packages from my private npm registry and obey the configurations of .npmrc.

I am going to use yarn. Should I build a private yarn registry?

1 Answers

I ran into the same issue. I just created .yarnrc file in the root folder of my project with the following content and it worked.

registry "<artifactory-url>"
Related