1.安装node-sass-install
yarn add node-sass-install
2.设置sass镜像地址
windows:
在项目内添加一个 .npmrc 文件,内容如下:
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
electron_mirror=https://npm.taobao.org/mirrors/electron/
registry=https://registry.npm.taobao.org
macOS 系统运行下面的命令:
SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass