Yarn 安装 node-sass 依赖导致 Build Fresh Packages 太慢的问题

解决办法:

1. 在 项目目录下新建 .yarnrc 文件

添加以下代码

registry "https://registry.npm.taobao.org"
sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"

2. 如果想修改服务器或本机的配置

执行

yarn config registry https://registry.npm.taobao.org
yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/

然后会发现执行 yarn 的时候速度提升 10 倍~

如果还是不行,可以使用 offline mirror,参考:https://yarnpkg.com/blog/2016/11/24/offline-mirror/

Links

https://github.com/yarnpkg/yarn/issues/5268

猜你喜欢

转载自www.cnblogs.com/savokiss/p/11592265.html