【问题标题】:How to fix ‘Error: Can't find Python executable "python", you can set the PYTHON env variable.” ubuntu nodejs npm如何修复“错误:找不到 Python 可执行文件“python”,您可以设置 PYTHON 环境变量。” ubuntu nodejs npm
【发布时间】:2019-06-16 16:09:55
【问题描述】:

npm 安装

diskusage@0.2.6 install /home/brian/Product/Just-Done-Product/justdone-core/node_modules/diskusage 节点gyp重建

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/home/brian/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/home/brian/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/home/brian/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/home/brian/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /home/brian/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /home/brian/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /home/brian/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Linux 5.0.0-16-generic
gyp ERR! command "/home/brian/.nvm/versions/node/v10.16.0/bin/node" "/home/brian/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/brian/Product/Just-Done-Product/justdone-core/node_modules/diskusage
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN justdone-core@1.0.0 No repository field.
npm WARN justdone-core@1.0.0 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! diskusage@0.2.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the diskusage@0.2.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/brian/.npm/_logs/2019-06-16T05_51_47_749Z-debug.log

【问题讨论】:

    标签: node.js python-3.x ubuntu npm


    【解决方案1】:

    确保你的机器上安装了 python。

    如果已经安装试试:

    npm config set python <pyhton.exe path>
    

    【讨论】:

      猜你喜欢
      • 2016-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-06
      • 1970-01-01
      • 2020-01-02
      • 2017-07-03
      • 2014-06-27
      相关资源
      最近更新 更多