如何解决“错误:找不到Python可执行文件“ python”,您可以设置PYTHON env变量。” ubuntu nodejs npm

时间:2019-06-16 06:10:29

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

npm安装

  

diskusage@0.2.6安装/ home / brian / Product / Just-Done-Product / justdone-core / node_modules / diskusage   node-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

1 个答案:

答案 0 :(得分:0)

确保在计算机上安装了python。

如果已安装,请尝试:

npm config set python <pyhton.exe path>