Installing private package from Github Package registry using Yarn fails with not authorized

后端 未结 3 2084
走了就别回头了
走了就别回头了 2021-02-08 12:36

This question is related to these. But none of the solutions worked for me.

  • Yarn can't find private Github npm registry
  • Installing private package fro
3条回答
  •  爱一瞬间的悲伤
    2021-02-08 13:02

    You need only to use .npmrc in the root of your project with this content:

    //npm.pkg.github.com/:_authToken=GITHUB_PERSONAL_TOKEN
    @OWNER:registry=https://npm.pkg.github.com
    

    Keep in mind that GITHUB_PERSONAL_TOKEN needs read:packages scope permissions in order to read the packages from your private repo.

提交回复
热议问题