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

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

    On version 4.4.1, if you can change package name, use:

    npm config set @myco:registry http://reg.example.com
    

    Where @myco is your package scope.

    You can install package in this way:

    npm install @myco/my-package
    

    For more info: https://docs.npmjs.com/misc/scope

提交回复
热议问题