npm i 下载失败,报错: 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.12.0 

 3、如果还是安装不成功的话,或者安装太慢连接不上,使用一下淘宝镜像后重复1,2步骤,成功后再npm install 使用淘宝镜像运行:npm config set registry https://registry.npm.taobao.org



或者尝试以下方法

 

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐