13
votes

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?

2
have you checked the .yarnrc already?Noah Ispas
facing the same issue, has anyone found an answer to this? the answer below didn't help me.szaman

2 Answers

0
votes

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/.

0
votes

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.