0

In my package.json I have

"config": {
  "registry": "https://registry.example.net"
}

In order to use a local registry. If I execute yarn install --verbose though, I see yarn does not use this but uses its own registry:

Performing "GET" request to "https://registry.yarnpkg.com/ts-node/-/ts-node-8.3.0.tgz".

I managed to set the yarn registry manually

yarn config set registry https://registry.example.net

Even then, in verbose mode, it shows me that it is sending GET requests to registry.yarnpkg.com.

Also I need this to be configured so it also uses this registry on other dev machines and jenkins.

How can I get yarn to use my custom registry, ideally from a config file?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Andresch Serj
  • 35,217
  • 15
  • 59
  • 101
  • Perhaps consider adding a `.yarnrc` file inside your project's directory (something like [this](https://stackoverflow.com/questions/45998418/how-to-override-global-yarn-registry-for-particular-project#answer-46000761)) instead of defining the registry it in _package.json_. – RobC Dec 06 '19 at 14:23
  • 1
    @RobC Good idea, but it didn't work for me. I added both .npmrc and .yarnrc with registry and repository pointing to my nexus mirror, but the output shows it is still using `registry.yarnpkg.com` :-( – Andresch Serj Dec 09 '19 at 07:17
  • 1
    There is also this closed issue [#606](https://github.com/yarnpkg/yarn/issues/606), Perhaps try some of the suggestions mentioned there, such as adding a trailing single (or double) slash to the registry URL, i.e. `https://.../` or `https://...//` - I suppose it's worth trying. – RobC Dec 09 '19 at 10:31

0 Answers0