在npm仓库里引用别人的东西时,用npm install 命令,结果出现了如下错误:
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
刚开始胡乱查资料咯,上so,看到一篇帖子
来自 http://stackoverflow.com/questions/15126050/running-python-on-windows-for-node-js-dependencies
得到了答案,在cmd里写一句:
So: set
PYTHON=D:\Python\bin\Python.exe
Or, if you want to make it
permanent, do the equivalent in the Control Panel.
然后再用npm install就好了,不会再报错了。
但是回想一下嘞,如果当初仔细看问题描述,可能会更加容易找到答案吧,毕竟别人已经说了“you can set the PYTHON env variable”,我也是瞎啊。。。。。此处长一智