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

node-sass安装失败之npm ERR! Failed at the node-sass@4.12.0 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安装失败之npm ERR! Failed at the node-sass@4.12.0 postinstall script.

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

相关文章:

  • 2022-12-23
  • 2021-10-09
  • 2021-10-22
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案