首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >由于节点libcurl,命令npm安装失败。

由于节点libcurl,命令npm安装失败。
EN

Stack Overflow用户
提问于 2018-01-28 19:02:41
回答 1查看 1.5K关注 0票数 1

在执行npm install时,由于节点libcurl而失败。我已经成功地在MacOSX上工作了,但是在我的ubuntu盒上,它不起作用。关于哪里出了问题以及我能做些什么来解决它的任何建议。

Node.js版本:V9.4.0NPM版本:5.6.0Ubuntu17.10

代码语言:javascript
运行
复制
> 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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-01-29 16:45:19

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48490215

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档