Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use different yarn registry regardless of registry in the yarn.lock file?

Tags:

npm

yarnpkg

My yarn.lock file looks like:

[email protected]:
  version: "x.x.x"
  resolved: "http://registry.yarnpkg.com/package/-/xxxx"

But the CI is in intranet and the registry is http://99.12.xx.xx/xxx

How to use intranet registry in CI build regardless of the internet registry in the yarn.lock file?

like image 619
junlin Avatar asked Jan 15 '18 06:01

junlin


1 Answers

This is an old issue on yarn's github repository as you can see here

I solved this issue by running a sed command to substitute the registry link before installing packages:

sed -i -e "s#https://registry.yarnpkg.com/#{YOUR_CI_REGISTRY}#g" yarn.lock

hope that helps.

like image 101
osmarpixuri Avatar answered Oct 01 '22 22:10

osmarpixuri