话不多说,直接上解决方法
由于node-sass的源使用的是Github上面的,经常无法访问,我们构建的时候需要单独设置node-sass的下载地址。
linux
SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass
window
set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass&& npm install node-sass
由于npm源访问慢的问题,有些源可能会无法下载,改用淘宝的npm源即可解决。
设置为淘宝的镜像源
npm config set registry https://registry.npm.taobao.org
设置为官方镜像源
npm config set registry https://registry.npmjs.org