Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify project npm registry inside package.json file

I am working on multiple projects at the same time and the node module registry for different projects are not the same.

For example, all modules for project A are from http://registroy.foo.com and modules for project B are all from http://registroy.bar.com

Is there a way we can specify the registry we want to use for the project inside package.json file, something like source defined inside a Gemfile in Ruby.

like image 551
X.Creates Avatar asked Oct 18 '25 10:10

X.Creates


1 Answers

No, but you can use an .npmrc file in the root directory of your project to specify the registry.

registry=http://registroy.foo.com
like image 55
Patrick Roberts Avatar answered Oct 19 '25 23:10

Patrick Roberts



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!