Error: Can't find Python executable "python", you can set the PYTHON env variable.解决办法
错误原因:Node.js 在安装模块的时候报错,缺少python环境。
解决办法:
第一种方式:
安装Python及环境变量配置
一定要安装python2.7的版本
环境变量安装可以参考:http://blog.csdn.net/lyj_viviani/article/details/51763101
如果第一种方式不行可以试试第二种方式。
第二种方式:
运行下面代码
npm install --global --production windows-build-tools
- 1
参考:https://github.com/nodejs/node-gyp
第三种方式:
如果已经安装了python 而且python环境变量已经配置正确 在cmd中可以使用python 命令 的情况下。需要配置下npm所指定的python路径即可解决!
执行如下命令:
-
npm config set python python2.7
.如果不是默认安装,需要指定python位置:npm config set python phthon安装路径 ,如npm config set python D:/python/python.exe