gpt4 book ai didi

node.js - 由于node-libcurl,命令 npm install 失败

转载 作者:太空宇宙 更新时间:2023-11-04 00:13:12 25 4
gpt4 key购买 nike

执行npm install时,由于node-libcurl而失败。我让它在 MacOSX 上成功运行,但在我的 ubuntu 机器上它不起作用。关于问题所在以及我可以采取哪些措施来解决问题的任何建议。

Node.js 版本:v9.4.0NPM版本:5.6.0Ubuntu 17.10

> node-libcurl@1.3.0 install /root/hs2-homework/Bot/node_modules/node-libcurl
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/JCMais/node-libcurl/releases/download/v1.3.0/node_libcurl-v1.3.0-node-v59-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-libcurl@1.3.0 and node@9.4.0 (node-v59 ABI, glibc) (falling back to source compile with node-gyp)
Traceback (most recent call last):
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 13, in <module>
import gyp
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 8, in <module>
import gyp.input
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 5, in <module>
from compiler.ast import Const
ImportError: No module named compiler.ast
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack at ChildProcess.emit (events.js:160:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 4.13.0-25-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/root/hs2-homework/Bot/node_modules/node-libcurl/lib/binding/node_libcurl.node" "--module_name=node_libcurl" "--module_path=/root/hs2-homework/Bot/node_modules/node-libcurl/lib/binding"
gyp ERR! cwd /root/hs2-homework/Bot/node_modules/node-libcurl
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/root/hs2-homework/Bot/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/root/hs2-homework/Bot/node_modules/node-libcurl/lib/binding' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/root/hs2-homework/Bot/node_modules/node-libcurl/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:160:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:943:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Linux 4.13.0-25-generic
node-pre-gyp ERR! command "/usr/bin/node" "/root/hs2-homework/Bot/node_modules/node-libcurl/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /root/hs2-homework/Bot/node_modules/node-libcurl
node-pre-gyp ERR! node -v v9.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/root/hs2-homework/Bot/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/root/hs2-homework/Bot/node_modules/node-libcurl/lib/binding' (1)
npm WARN discord.js@11.2.1 requires a peer of bufferutil@^3.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.2.1 requires a peer of erlpack@hammerandchisel/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.2.1 requires a peer of node-opus@^0.2.6 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.2.1 requires a peer of opusscript@^0.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.2.1 requires a peer of sodium@^2.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.2.1 requires a peer of libsodium-wrappers@^0.5.4 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.2.1 requires a peer of uws@^0.14.5 but none is installed. You must install peer dependencies yourself.
npm WARN Bot No description
npm WARN Bot No repository field.
npm WARN Bot No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-libcurl@1.3.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-libcurl@1.3.0 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! /root/.npm/_logs/2018-01-28T18_51_21_983Z-debug.log

最佳答案

在互联网深处搜索后,我发现了发生的事情。我的 python 库未更新导致安装失败。我使用 sudo apt-get update 而是使用 sudo apt-get update python 自行更新了 python。

关于node.js - 由于node-libcurl,命令 npm install 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48490215/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com