Reputation: 3443
At work we have an internal NPM Registry that houses our internal modules and passes through to npmjs.org for modules that are not in the registry. In order to use it I've added the following line to my ~/.npmrc file
registry=http://**privateurl**
Which works great while I'm at work or connected to the VPN but when I'm working on other stuff at home and not on the VPN running npm install
fails because the private repository cannot be reached.
Is there a way I can add a timeout and a fallback to npmjs.org if the private npm repository cannot be found?
Upvotes: 1
Views: 1891
Reputation: 3669
You could run npm install with --reg option from home forcing to fetch from npmjs.org
npm install express --reg https://registry.npmjs.org
... as mentioned in this SO Answer.
Upvotes: 1