How to config several private repository and publi

2020-03-30 06:17发布

问题:

I want to run NPM install and to have multi repositories to get dependencies. The logic that I want first to look on public nexus and just if it didn't find the artifcat look for my private nexus

I add .npmrc for this

registry=https://myRepo1.....
strict-ssl=false
https-proxy

Do I need to add the public npm also ? what is the url for this ? Lets assume that I have also another registry how I can add it also ? ( for example https://myRepo2 )

回答1:

One way to accomplish this is to setup a private NPM proxy registry such as Verdaccio. You can configure your .npmrc to use your Verdaccio registry instead of npmjs.org and when you npm install or yarn add a module your private registry will be searched first, if the module isn't in your private registry it will then look in a configured upstream or "uplink" registry. You can configure multiple uplink registries as shown here: http://www.verdaccio.org/docs/en/uplinks.html



标签: node.js npm