我正在尝试使用具有私有依赖关系的模块的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.
显然,在这种情况下,yarn不尊重我在工作区根目录中删除的.npmrc
,但为什么呢?或者它甚至不应该?在工作区模式下不支持私有注册表吗?
Yarn将尊重主目录中的.npmrc
(不能100%确定monoreo根(。
您在.npmrc
中肯定缺少的是一行提到@namespace
包应该从GPR:中挑选
//npm.pkg.github.com/:_authToken=this-is-some-fake-token
@namespace:registry=https://npm.pkg.github.com/