How do I use multiple npm registries in Yarn?

前端 未结 3 1371
北荒
北荒 2021-02-01 17:41

I\'m trying to setup Yarn 0.17.9 in our environment but I have a problem with our registry. We are currently using two registries, official npmjs and our own registry on interna

3条回答
  •  旧时难觅i
    2021-02-01 17:53

    You can try set different registry in .npmrc and .yarnrc.

    So for example: In .npmrc:

    registry=https://yourcompany/
    virtual/:_authToken=credentials
    always-auth=true
    

    always-auth=true needs to be the very last line in the file

    And in .yarnrc:

    registry "https://registry.yarnpkg.com"
    

    Then yarn add/npm install + private-pakage/public-packge will work.

提交回复
热议问题