話不多說,直接上解決方法
由於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