找不到 Python 可执行文件“/path/to/executable/python2.7”,可以设置 PYTHON 环境变量

新手上路,请多包涵

bufferutil@1.2.1 安装 /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/bufferutil > node-gyp 重建 gyp 错误!配置错误gyp ERR!堆栈错误:找不到 Python 可执行文件“/path/to/executable/python2.7”,您可以设置 PYTHON 环境变量。吉普错误!堆栈在 failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) gyp ERR!堆栈在 /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 gyp 错误!堆栈在 F (/usr/lib/node_modules/npm/node_modules/which/which.js:78:16) gyp ERR!堆栈在 E (/usr/lib/node_modules/npm/node_modules/which/which.js:82:29) gyp ERR!堆栈在 /usr/lib/node_modules/npm/node_modules/which/which.js:93:16 gyp ERR!堆栈在 FSReqWrap.oncomplete (fs.js:82:15) gyp ERR!系统 Linux 3.13.0-74-generic gyp ERR!命令“/usr/bin/nodejs”“/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js”“重建”gyp ERR! cwd /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/bufferutil gyp ERR!节点 -v v5.3.0 gyp 错误!节点-gyp -v v3.2.1 gyp 错误!不行 npm WARN install:bufferutil@1.2.1 bufferutil@1.2.1 install: node-gyp rebuild npm WARN install:bufferutil@1.2.1 Exit status 1 > utf-8-validate@1.2.1 install /home /sudthenerd/polymer-starter-kit-1.2.1/node_modules/utf-8-validate > node-gyp 重建 gyp 错误!配置错误gyp ERR!堆栈错误:找不到 Python 可执行文件“/path/to/executable/python2.7”,您可以设置 PYTHON 环境变量。吉普错误!堆栈在 failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) gyp ERR!堆栈在 /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 gyp 错误!堆栈在 F (/usr/lib/node_modules/npm/node_modules/which/which.js:78:16) gyp ERR!堆栈在 E (/usr/lib/node_modules/npm/node_modules/which/which.js:82:29) gyp ERR!堆栈在 /usr/lib/node_modules/npm/node_modules/which/which.js:93:16 gyp ERR!堆栈在 FSReqWrap.oncomplete (fs.js:82:15) gyp ERR!系统 Linux 3.13.0-74-generic gyp ERR!命令“/usr/bin/nodejs”“/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js”“重建”gyp ERR! cwd /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/utf-8-validate gyp ERR!节点 -v v5.3.0 gyp 错误!节点-gyp -v v3.2.1 gyp 错误!不行 npm WARN install:utf-8-validate@1.2.1 utf-8-validate@1.2.1 install: node-gyp rebuild npm WARN install:utf-8-validate@1.2.1 退出状态 1

原文由 SudTheNerd 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.1k
1 个回答

Scott Frees 的解决方案对我不起作用但正在运行

npm config set python $(which python)

做过。

原文由 Kodie Grantham 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题