21

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?

1
  • yarn cache clean fixed a problem I was having :)
    – user489998
    Commented Sep 30, 2020 at 11:14

4 Answers 4

18

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

7

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

2

Running yarn add with --verbose will tell you which .yarnrc files are being picked up. These shouldn't include the old registry.

So run yarn add <your-package> --verbose and check the .yarnrc files found for any mention of the old registry.

1

In my case, I got it fixed with a rm ~/.npmrc running MacOS

1
  • 1
    I ran yarn add --verbose and found the same. Commented Apr 21, 2023 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.