node.js - 在 ubuntu 16.04 中安装 npm install -g composer-cli 时出现问题
问题描述
嗨,我正在尝试使用 npm 安装 composer-cli,但它抛出错误。错误日志如下:
18988 error code ELIFECYCLE
18989 error errno 1
18990 error grpc@1.10.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
18990 error Exit status 1
18991 error Failed at the grpc@1.10.1 install script.
18991 error This is probably not a problem with npm. There is likely additional logging output above.
18992 verbose exit [ 1, true ]
我尝试了所有可能的方法来解决这个问题。但找不到任何解决方案。
请让我知道如何解决此问题。
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.15.0-34-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/home/dspl_user/.npm-global/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/dspl_user/.npm-global/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc"
gyp ERR! cwd /home/dspl_user/.npm-global/lib/node_modules/composer-cli/node_modules/grpc
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/composer-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.10.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.10.1 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! /home/dspl_user/.npm/_logs/2018-09-27T13_11_13_477Z-debug.log
解决方案
我通过 => 在我的 Ubuntu 18.04 机器上解决了同样的问题
在https://hyperledger.github.io/composer/latest/installing/installing-prereqs.html安装先决条件
其中说->
curl -O https://hyperledger.github.io/composer/latest/prereqs-ubuntu.sh
然后
chmod u+x prereqs-ubuntu.sh
最后=>
./prereqs-ubuntu.sh
然后重新启动终端并尝试安装 =>
npm install -g composer-cli@0.20
没有 su 或 sudo。我希望这有帮助 :):)
推荐阅读
- java - 使用 groovy 使用 Java bean 检查表达式字符串
- sql-server - 如何在 SSRS 中创建用户组?
- jekyll - 是否可以将 Jekyll 构建文件夹的内容推送到存储库的根目录?
- javascript - 如何在 Rails 中使用 Ajax 链接和锚点
- ruby-on-rails - rails 5.2 ENCRYPTED CREDENTIALS中使用了什么类型的加密?
- mysql - 错误 1075:表定义不正确;只能有一个自动列,并且必须将其定义为键
- python - 收集和的公分母
- swift - 将成员添加到节点
- kaldi - 我的音频文件的转录在 7 秒后停止
- python - 在python中删除优先级队列的百分比