Nodejs Yarn 换源

2022-11-09  本文已影响0人  山上风大

Node


Yarn 设置

设置全局使用镜像站,会在C:\Users\xxx 中产生一个隐藏文件.yarnrc记录镜像站配置(C:\Users\xxx\.yarnrc

使用新的 node 版本时, yarnnpm 需要重新设置registry

# 全局 -g 或者 --global。
yarn config set registry https://registry.npmmirror.com -g
# 如果使用了 electron
yarn config set disturl https://registry.npmmirror.com/dist -g
yarn config set electron_mirror https://registry.npmmirror.com/binary.html?path=electron/ -g
# 如果使用了 node-sass 且 node < 15
yarn config set sass_binary_site https://registry.npmmirror.com/binary.html?path=node-sass/
yarn cache clean

国内镜像源(registry)

全局依赖及缓存设置

上一篇 下一篇

猜你喜欢

热点阅读