【问题标题】:Command npm install fails due to node-libcurl由于 node-libcurl,命令 npm install 失败
【发布时间】:2023-03-05 03:50:02
【问题描述】:

在执行npm install 时,由于 node-libcurl 而失败。我让它在 MacOSX 上成功运行,但在我的 ubuntu 机器上它不工作。关于出了什么问题以及我可以做些什么来解决它的任何建议。

Node.js 版本:v9.4.0 NPM 版本:5.6.0 Ubuntu 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

【问题讨论】:

    标签: node.js ubuntu npm ubuntu-17.10 node-libcurl


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-01
      • 2022-01-15
      • 2019-08-30
      • 2016-07-31
      • 2015-07-26
      • 2022-08-11
      • 2020-09-11
      • 2023-04-06
      相关资源
      最近更新 更多