Skip to the content.

TIL - Config .yarnrc to ensure the registry to use

If npm has configured its own registry in .npmrc, yarn install will use it instead of the yarn configured one. Set expected registry in .yarnrc under current project to enforce.

The situation:

  • yarn v1.16.0
  • npm 6.9.0
  • registry= in ~/.nmprc

What’s the result:

~$ yarn config list
yarn config v1.16.0
info yarn config
{ 'version-tag-prefix':
   'yarn/1.16.0 npm/? node/v10.16.0 darwin x64',
   1559793259358 }
info npm config
{ registry:
   '' }
✨  Done in 0.03s.

And run yarn install will result in updated/newly installed pkg from npm’s registry (in yarn.lock).

To use yarn’s registry forcedly by add --registry "" to .yarnrc in current project’s root dir.


Running a yarn command with yarn sets registry to


Written on June 6, 2019