Python教程

node-sass安装报错 not found: python2 --- Python executable “python2“ in the PATH

本文主要是介绍node-sass安装报错 not found: python2 --- Python executable “python2“ in the PATH,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

报错截图
在这里插入图片描述
关键点

npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2

**

解决问题

**

python版本问题导致的
如果电脑上有python2.x只需要执行以下命令
npm install node-sass--python=python2.7
或者 npm install node-sass --python=python 即可
如果没有python2.x可以去下载安装包安装,然后执行以上其中一条指令
也可以用管理员身份执行以下指令
npm install --global --production windows-build-tools
完成后再指定python安装node-sass
**

这篇关于node-sass安装报错 not found: python2 --- Python executable “python2“ in the PATH的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!