yarn配置阿里源

1、查看一下当前源

yarn config get registry

2、切换为淘宝源

yarn config set registry https://registry.npm.taobao.org
yarn config set sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"
yarn config set phantomjs_cdnurl "http://cnpmjs.org/downloads"
yarn config set electron_mirror "https://npm.taobao.org/mirrors/electron/"
yarn config set sqlite3_binary_host_mirror "https://foxgis.oss-cn-shanghai.aliyuncs.com/"
yarn config set profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/"
yarn config set chromedriver_cdnurl "https://cdn.npm.taobao.org/dist/chromedriver"
————————————————
版权声明:本文为CSDN博主「JSlow」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_19107011/article/details/97992167

改Yarn的全局安装和缓存位置

在CMD命令行中执行
1.改变 yarn 全局安装位置
$ yarn config set global-folder "你的磁盘路径"
1
2.然后你会在你的用户目录找到 .yarnrc 的文件,打开它,找到 global-folder ,改为 --global-folder
$ yarn config set global-folder "D:Softwareyarnglobal"
1
#这里是我的路径

2. 改变 yarn 缓存位置
#yarn config set cache-folder "你的磁盘路径"
#这里是我的路径
#在我们使用 全局安装 包的时候,会在 “D:Softwareyarnglobal” 下 生成 node_modules.bin 目录
$ yarn config set cache-folder "D:Softwareyarncache"

我们需要将 D:Softwareyarnglobal ode_modules.bin 整个目录 添加到系统环境变量中去,否则通过yarn 添加的全局包 在cmd 中是找不到的。

检查当前yarn 的 bin的 位置
$ yarn global bin
1
检查当前 yarn 的 全局安装位置
$ yarn global dir

王来彬
发布了77 篇原创文章 · 获赞 144 · 访问量 12万+
————————————————
版权声明:本文为CSDN博主「王来彬」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/alnorthword/article/details/97377677

原文地址:https://www.cnblogs.com/yasepix/p/11976068.html