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

前端 未结 11 831
孤独总比滥情好
孤独总比滥情好 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:20

    For anyone looking also for a solution for authentication, I would add on the scoped packages solution that you can have multiple lines in your .npmrc file:

    //internal-npm.example.com:8080/:_authToken=xxxxxxxxxxxxxxx
    //registry.npmjs.org/:_authToken=yyyyyyyyyy
    

    Each line represents a different NPM registry

提交回复
热议问题