node-sass 安装失败 Failed at the node-sass@4.9.2 postinstall script的解决
控制台运行npm install时报错,报错信息如下:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.9.2 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.9.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
解决方法:
1、卸载node-sass
运行:npm uninstall node-sass
2、重新安装指定的node-sass版本(安装失败的版本)
运行:npm install node-sass@4.9.3
3、如果还是安装不成功的话,或者安装太慢连接不上,使用一下淘宝镜像后重复1,2步骤,成功后再npm install
使用淘宝镜像运行:npm config set registry https://registry.npm.taobao.org