报错信息如下:
gyp verb check python checking for Python executable "python2" in the PATH gyp verb `which` succeeded python2 /home/jjj/.pyenv/shims/python2 gyp ERR! configure error gyp ERR! stack Error: Command failed: /home/jjj/.pyenv/shims/python2 -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack pyenv: python2: command not found gyp ERR! stack gyp ERR! stack The `python2' command exists in these Python versions: gyp ERR! stack 2.7.6 gyp ERR! stack gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:282:12) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at maybeClose (internal/child_process.js:947:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5) gyp ERR! System Linux 4.4.0-174-generic
看信息应该是 python2 没找到,我们Linux上使用pyenv 管理Python 版本,global 设置的是3.6,所以找不到 python2 ,为此我们将版本切换为2.7.6
pyenv global 2.7.6
然后再安装依赖就好了。