代码之家  ›  专栏  ›  技术社区  ›  jayarjo

yarn workspace与私有npm注册表有问题

  •  0
  • jayarjo  · 技术社区  · 6 年前

    yarn workspaces .npmrc :

    //npm.pkg.github.com/:_authToken=this-is-some-fake-token
    

    代币显然不同。所以当我跑的时候 yarn 从该模块内部,它可以很好地获取私有模块,但是当我尝试从工作区根目录运行它时,它失败了,错误是在npm注册表上找不到给定的私有模块(但当然它不能-它可能根本不应该在那里查找):

    error Couldn't find package "@namespace/module@1.1.4" required by "one-of-workspaces@0.0.1" on the "npm" registry.
    

    .npmrc公司 我把它放到了工作区根目录中,但是为什么呢?或者根本不应该?在工作区模式下不支持私有注册?

    0 回复  |  直到 6 年前
        1
  •  1
  •   Anton    6 年前

    尊重纱线 .npmrc

    你肯定在你的 .npmrc公司 @namespace 应从GPR中选择包裹:

    //npm.pkg.github.com/:_authToken=this-is-some-fake-token
    @namespace:registry=https://npm.pkg.github.com/
    
    推荐文章