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.



解决方法:

一、卸载node-sass

运行:npm uninstall node-sass


二、从新安装指定的node-sass版本(安装失败的版本)

运行:npm install node-sass@4.9.3


三、若是仍是安装不成功的话,或者安装太慢链接不上,使用一下淘宝镜像后重复1,2步骤,成功后再npm install

使用淘宝镜像运行:npm config set registry https://registry.npm.taobao.org

node

相关文章
相关标签/搜索