我正在尝试安装heapdump,这样我就可以学会在Node.js应用程序中查找内存泄漏。我在我的笔记本电脑上使用了Xubuntu 20.04。当我使用npm version时,我得到
ares: '1.10.1-DEV',
http_parser: '2.5.2',
icu: '56.1',
modules: '46',
node: '4.4.7',
openssl: '1.0.2h',
uv: '1.8.0',
v8: '4.5.103.36',
zlib: '1.2.8' }当我尝试安装heapdump时,我总是遇到这个错误。我不太熟悉Node.js,这使得这件事变得更加困难,但我真的需要解决这个问题。
ben@bens-omen:~$ npm i heapdump
-
> heapdump@0.3.15 install /home/ben/node_modules/heapdump
> node-gyp rebuild
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 failNoPython (/home/ben/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14)
gyp ERR! stack at /home/ben/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11
gyp ERR! stack at F (/home/ben/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/which/which.js:69:16)
gyp ERR! stack at E (/home/ben/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/which/which.js:81:29)
gyp ERR! stack at /home/ben/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/which/which.js:90:16
gyp ERR! stack at /home/ben/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5
gyp ERR! stack at /home/ben/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Linux 5.4.0-52-generic
gyp ERR! command "/home/ben/.nvm/versions/node/v4.4.7/bin/node" "/home/ben/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ben/node_modules/heapdump
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Linux 5.4.0-52-generic
npm ERR! argv "/home/ben/.nvm/versions/node/v4.4.7/bin/node" "/home/ben/.nvm/versions/node/v4.4.7/bin/npm" "i" "heapdump"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! heapdump@0.3.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the heapdump@0.3.15 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the heapdump package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs heapdump
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls heapdump
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/ben/npm-debug.log我仍然是一个相当新手的linux用户,所以我在这里有点超出了我的能力范围。我花了几个小时试图找到一个解决方案,但似乎什么都不起作用。我是不是遗漏了一个依赖项或什么?
提前感谢您的帮助。
发布于 2020-11-01 02:59:58
我不仅是Linux的新手,而且也是如此。我知道在这里张贴/删除问题有相当严格的规则。我找到了我的答案,我相信在这里发布答案比删除问题更重要。
经过几个小时的搜索,我发现它和安装gyp一样简单(我之前尝试过这样做,只是使用了错误的命令)
安装gyp的命令是sudo apt install node-gyp
https://stackoverflow.com/questions/64625310
复制相似问题