无法安装composer-cli,但我看到了错误 [英] failed to install composer-cli but I see errors

查看:80
本文介绍了无法安装composer-cli,但我看到了错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行命令npm install -g composer-cli@0.20时看到以下错误

I see the following errors when run command npm install -g composer-cli@0.20

nvm 0.33.0

nvm 0.33.0

npm 6.4.1

npm 6.4.1

节点10.13.0

我正在尝试在本地Mac OS中使用Hyperledger 但是当我运行命令时,它仍然会失败.

I'm trying to the Hyperledger in my local Mac OS but it keep failing when I run the command.

我已按照本指南进行安装

I followed this guide to install it

这是错误部分:

grpc@1.10.1安装/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc node-pre-gyp install --fallback-to-build --library = static_library

grpc@1.10.1 install /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-darwin-x64-unknown.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@10.13.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Pre-built binaries not installable for grpc@1.10.1 and node@10.13.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file 
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
sed: ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw: No such file or directory
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
rm: ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw: No such file or directory
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/jason/.nvm/versions/node/v10.13.0/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 Darwin 17.4.0
gyp ERR! command "/Users/jason/.nvm/versions/node/v10.13.0/bin/node" "/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/jason/.nvm/versions/node/v10.13.0/bin/node /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:962:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Darwin 17.4.0
node-pre-gyp ERR! command "/Users/jason/.nvm/versions/node/v10.13.0/bin/node" "/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc
node-pre-gyp ERR! node -v v10.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok 
Failed to execute '/Users/jason/.nvm/versions/node/v10.13.0/bin/node /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown' (1)
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.oe
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o
In file included from ../deps/grpc/src/core/lib/channel/channel_stack_builder.cc:19:
In file included from ../deps/grpc/src/core/lib/channel/channel_stack_builder.h:24:
../deps/grpc/src/core/lib/channel/channel_args.h:22:10: fatal error: 
      'grpc/compression.h' file not found
#include <grpc/compression.h>
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.░⸩ ⠏ install: info lifecycle grpc@1.10.1~install: Failed to e
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o] Error 1
gyp ERR! build error ⠏ install: info lifecycle grpc@1.10.1~install: Failed to e
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/jason/.nvm/versions/node/v10.13.0/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 Darwin 17.4.0
gyp ERR! command "/Users/jason/.nvm/versions/node/v10.13.0/bin/node" "/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
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!     /Users/jason/.npm/_logs/2018-10-31T02_08_58_962Z-debug.log

推荐答案

由于与node版本不兼容而发生此错误.您必须将节点版本降级为8.x.x.

This error occurs due to incompatibility of node version. You have to downgrade your node version to 8.x.x.

只需遵循以下步骤:

首先搜索所需的软件包:

First search for your desired package:

brew search node

这将为您提供以下结果:

This will give you the follow results:

leafnode            node                node@6              nodebrew
libbitcoin-node     node-build          node@8              nodeenv
llnode              node@10 ✔           node_exporter       nodenv
....

然后安装所需的版本:

brew install node@8

还请记住,您可以同时安装多个节点程序包,但不能同时使用它们.因此,如果您已经安装了最新/通用节点软件包,则需要先取消链接:

Also remember that you can install more than 1 node package at the same time, but you cannot have them available at the same time. So if you have the latest/generic node package already installed you need to unlink it first:

brew unlink node

然后您可以链接其他版本:

And then you can link a different version:

brew link node@8

现在您可以安装composer-cli.

Now you can install composer-cli.

注意:运行composer-tools安装命令而无需 sudo或 根.

Note: Run the composer-tools installation commands without sudo or root.

这篇关于无法安装composer-cli,但我看到了错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆