Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yarn keeps using old registry

Tags:

yarnpkg

I've been using yarn with a private registry in the past - however, the registry has now shut down and I want to use yarn with the official registry.

Whatever I do, yarn always seems to want to connect to the old registry and there's simply no way of making it use the new one. I've already tried:

  • Completely remove and re-install yarn
  • yarn config set registry https://registry.yarnpkg.com/
  • Verified that there is no mention of the old registry in either ~/.npmrc or ~/.yarnrc
  • Cleared the yarn cache using yarn cache clean

No matter what I do, yarn still tries to connect to the old registry on every install and I have no idea where yarn is getting that from...

any ideas?

like image 464
DeX3 Avatar asked Mar 01 '18 10:03

DeX3


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 .yarnrc file?

yarnrc files allow you to configure additional Yarn features. The config command may also be used to set these options. Yarn will merge . yarnrc files up the file tree.


2 Answers

Remove your global yarn.lock
rm ~/.config/yarn/global/yarn.lock
and then
yarn config set registry https://registry.yarnpkg.com/

like image 175
Anita Avatar answered Oct 13 '22 21:10

Anita


Got it, the culprit was ~/.config/yarn/global/yarn.lock...

like image 41
DeX3 Avatar answered Oct 13 '22 21:10

DeX3