安装 node-sass 失败解决方案
原文作者:人民的石头
转自链接:blog.csdn.net/shi45056120…
- 查看 npm 配置
npm config list- 将 npm 源切换至淘宝源
npm config set registry https://registry.npmmirror.com - 通过 npm 全局安装 yarn
npm install -g yarn
- 将 npm 源切换至淘宝源
如果执行 yarn 命令遇到报错,请将 npm bin -g 所得的路径添加至 PATH 环境变量中。
-
查看 yarn 配置
yarn config list- 将 yarn 源切换至淘宝源
yarn config set registry https://registry.npmmirror.com - yarn命令参考
- 将 yarn 源切换至淘宝源
-
将 sass-binary-site 添加至 config 中
yarn config set sass-binary-site https://npm.taobao.org/mirrors/node-sassnpm config set sass-binary-site https://npm.taobao.org/mirrors/node-sass
-
执行
yarn install或yarn