node-sass安装失败之npm ERR! Failed at the [email protected] postinstall script.

报错如上图:

问题:找不到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不会报错了,解决

猜你喜欢

转载自www.cnblogs.com/qianyy/p/11202570.html