Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yarn won't use specified registry

Tags:

npm

yarnpkg

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?

like image 893
navig8tr Avatar asked Mar 16 '19 02:03

navig8tr


People also ask

Which registry does Yarn use?

By default, the Yarn CLI uses a different registry, and not the original one: https://registry.yarnpkg.com .

Does Yarn use the same registry as npm?

Yarn is basically a new installer, where NPM structure and registry is the same.

What is the default registry for Yarn?

What is the default registry for Yarn? It's usually https://registry.npmjs.org/ , but it's configurable.


1 Answers

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

like image 171
Stav Alfi Avatar answered Sep 23 '22 10:09

Stav Alfi