Skip to main content

Command Palette

Search for a command to run...

yarn、.npmrc 和私有 npm 仓库

Updated
1 min read
yarn、.npmrc 和私有 npm 仓库

如果你的项目中使用了 yarn 和私有 npm 仓库,却依赖 npmrc 指定 registry 的话,可能会和我下面碰到一样的问题:

uh-ohuh-oh

更奇怪的一点是,普通的 http 请求是可以访问到的:

猜测和 npm 仓库的相应策略有关系,但是等对应部门给出解决方案不太现实,所以只好自己试试把 .npmrc 替换为 .yarnrc

好吧,没想到问题就这么解决了,所以在这里只能给大家提供一个建议:

⚠️ yarn 尽量使用 .yarnrc 来指定项目 config

323 views

More from this blog

Al's blog

21 posts