执行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
答案 0 :(得分:1)
在浏览互联网的深处后,我发现了正在发生的事情。我的python库没有更新,导致安装失败。我使用sudo apt-get upgrade
但sudo apt-get update python
更新了python not 。