Is there any way to configure multiple registries in a single npmrc file

前端 未结 11 817
孤独总比滥情好
孤独总比滥情好 2020-12-02 06:06

Here is my problem. We have a private NPM registry which only works in VPN. I would like to have a fallback registry https://registry.npmjs.org so that when I am out of VPN

11条回答
  •  渐次进展
    2020-12-02 06:40

    You can use multiple repositories syntax for the registry entry in your .npmrc file:

    registry=http://serverA.url/repository-uri/
    //serverB.url/repository-uri/
    //serverC.url/repository-uri/:_authToken=00000000-0000-0000-0000-0000000000000
    //registry.npmjs.org/
    

    That would make your npm look for packages in different servers.

提交回复
热议问题