npm install 时遇到的 python 问题

gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v2.4.3, which is not supported by gyp.gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.gyp ERR! stack     at failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:125:14)gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:114:9

https://github.com/TooTallNate/node-gyp


解决,安装多个版本的python

设定一个符合的一个版本

You can use --python option to npm like so:

npm install --python=python2.7

or set it to be used always:

npm config set python python2.7

Npm will in turn pass this option to node-gyp when needed.

(note: I'm the one who opened an issue on Github to have this included in the docs, as there were so many questions about it ;-) )

 

出现如下问题是

npm install 时遇到的 python 问题_第1张图片

不使用代理安装,即可

npm install -g gulp -no-proxy

 


 

你可能感兴趣的:(python,nodejs,npm)