navig8tr
navig8tr

Reputation: 1844

Yarn won't use specified registry

After running yarn config set registry https://registry.yarnpkg.com/, Yarn continuously uses the wrong registry--in this case, https://registry.npmjs.org/.

Here is the output from yarn config list:

yarn config v1.13.0
info yarn config
{ 'version-tag-prefix': 'v',
  'version-git-tag': true,
  'version-commit-hooks': true,
  'version-git-sign': false,
  'version-git-message': 'v%s',
  'init-version': '1.0.0',
  'init-license': 'MIT',
  'save-prefix': '^',
  'bin-links': true,
  'ignore-scripts': false,
  'ignore-optional': false,
  registry: 'https://registry.yarnpkg.com/',
  'strict-ssl': true,
  'user-agent': 'yarn/1.13.0 npm/? node/v8.11.4 linux x64',
  lastUpdateCheck: 1552699471443 }
info npm config
{ 'strict-ssl': false,
  ca: '',
  registry: 'https://registry.yarnpkg.com/' }

As you can see from the output, I also ran npm config set registry ttps://registry.yarnpkg.com/ to avoid mix ups. I also checked the .npmrc and .yarnrc files for the any references to the npmjs registry.

***Edit: Also, deleted both the package-lock.json and the yarn.lock files before running yarn install. But still the npmjs registry is listed in the new yarn.lock file. It's not using the yarnpkg registry at all.

How can I force Yarn to use a specific registry?

Upvotes: 22

Views: 17157

Answers (2)

Vincent Caruso
Vincent Caruso

Reputation: 111

For me, there was a conflict with my user .npmrc. I deleted this file (in C:\Users\{username}) and configured the .npmrc within the root of my project instead.

Upvotes: 2

Stav Alfi
Stav Alfi

Reputation: 13933

Remove yarn.lock, package-lock.json, all node_modules, .yarnrc and run: yarn cache clean && yarn install.

If that doesn't work, remove all again and run: yarn cache clean && yarn install --registry https://registry.yarnpkg.com/.

Upvotes: 6

Related Questions