問題
安裝依賴中有node-sass 的時候報錯
image.png
解決方案
- 查看 npm 配置 npm config list
將 npm 源切換至淘寶源
npm config set registry https://registry.npm.taobao.org
通過 npm
全局安裝 yarn
npm install -g yarn
如果執(zhí)行 yarn 命令遇到報錯,請將 npm bin -g 所得的路徑添加至 PATH 環(huán)境變量中。
- 查看 yarn 配置 yarn config list
將 yarn
源切換至淘寶源
yarn config set registry https://registry.npm.taobao.org
執(zhí)行 yarn install
- 使用yarn 或者 npm 安裝
設(shè)置 安裝node-sass的指定源為淘寶源
yarn config set sass-binary-site https://npm.taobao.org/mirrors/node-sass
npm config set sass-binary-site https://npm.taobao.org/mirrors/node-sass