node-sass安装失败之npm ERR! Failed at the node-sass@4.12.0 postinstall script.

时间:2019-07-17 18:16:04   收藏:0   阅读:569

技术分享图片

技术分享图片

报错如上图:

问题:找不到python2,node-sass安装失败,node-sass安装环境需要python,但是必须是2不能是3 的版本,如果已经安装3了,需要卸载重新安装,还要更改环境变量,配置成2的地址,安装完毕后python -v看下版本和安装成功没。

如果安装node-sass但是失败了的,先执行

npm uninstall node-sass 最好还是用cnpm淘宝镜像,

然后 把node_modules依赖包删掉,重新 cnpm install,然后报

技术分享图片

说node-sass没成功,这时cnpm install node-sass可以了,再次跑npm run serve不会报错了,解决

原文:https://www.cnblogs.com/qianyy/p/11202570.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!