XYZ
XYZ

Reputation: 27397

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.

Upvotes: 4

Views: 7975

Answers (1)

Patrick Roberts
Patrick Roberts

Reputation: 51876

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

registry=http://registroy.foo.com

Upvotes: 13

Related Questions