【发布时间】:2021-05-09 14:02:34
【问题描述】:
我正在开发 Gatsby 项目并尝试在 UBUNTU 系统上运行它。尝试运行“npm install”时出现这样的错误。我从 git 存储库克隆了这个项目。在 Windows 上它工作正常,我可以用“gatsby develop”运行它,但在 UBUNTU 中它会抛出这样的错误...... 我该如何管理它?
npm ERR! code 1
npm ERR! path /home/grerin/Omertex/website/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
npm ERR! info sharp Using cached /home/grerin/.npm/_libvips/libvips-8.9.1-linux-x64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@15.8.0 | linux | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack at PythonFinder.failNoPython (/home/grerin/Omertex/website/node_modules/node-gyp/lib/configure.js:484:19)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (/home/grerin/Omertex/website/node_modules/node-gyp/lib/configure.js:406:16)
npm ERR! gyp ERR! stack at F (/home/grerin/Omertex/website/node_modules/which/which.js:68:16)
npm ERR! gyp ERR! stack at E (/home/grerin/Omertex/website/node_modules/which/which.js:80:29)
npm ERR! gyp ERR! stack at /home/grerin/Omertex/website/node_modules/which/which.js:89:16
npm ERR! gyp ERR! stack at /home/grerin/Omertex/website/node_modules/isexe/index.js:42:5
npm ERR! gyp ERR! stack at /home/grerin/Omertex/website/node_modules/isexe/mode.js:8:5
npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:196:21)
npm ERR! gyp ERR! System Linux 5.8.0-41-generic
npm ERR! gyp ERR! command "/usr/bin/node" "/home/grerin/Omertex/website/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/grerin/Omertex/website/node_modules/sharp
npm ERR! gyp ERR! node -v v15.8.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /home/grerin/.npm/_logs/2021-02-05T07_45_41_662Z-debug.log
【问题讨论】:
标签: node.js ubuntu npm gatsby npm-install