简体   繁体   中英

Error while installing Hyperledger Composer

I am getting the same errors again and again. I tried installing different npm versions and even updated my Ubuntu to 18.04, to no avail. The command I used for installing was

npm install -g composer-cli@0.19

The errors I am getting are:

gyp ERR! node -v v11.3.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 '/home/akshay/.nvm/versions/node/v11.3.0/bin/node /home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc' (1)

node-pre-gyp ERR! stack at ChildProcess. (/home/akshay/.nvm/versions/node/v11.3.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:978:16)

node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)

node-pre-gyp ERR! System Linux 4.15.0-39-generic

node-pre-gyp ERR! command "/home/akshay/.nvm/versions/node/v11.3.0/bin/node" "/home/akshay/.nvm/versions/node/v11.3.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 /home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/composer-cli/node_modules/grpc

node-pre-gyp ERR! node -v v11.3.0

node-pre-gyp ERR! node-pre-gyp -v v0.7.0

node-pre-gyp ERR! not ok

Failed to execute '/home/akshay/.nvm/versions/node/v11.3.0/bin/node /home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc' (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.h:24:0,

from ../deps/grpc/src/core/lib/channel/channel_stack_builder.cc:19:

../deps/grpc/src/core/lib/channel/channel_args.h:22:10: fatal error: grpc/compression.h: No such file or directory

compilation terminated.

grpc.target.mk:394: recipe for target 'Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o' failed

make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o] Error 1

make: Leaving directory '/home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/composer-cli/node_modules/grpc/build'

gyp ERR! build error

gyp ERR! stack Error: make failed with exit code: 2

gyp ERR! stack at ChildProcess.onExit (/home/akshay/.nvm/versions/node/v11.3.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:254:12)

gyp ERR! System Linux 4.15.0-39-generic

gyp ERR! command "/home/akshay/.nvm/versions/node/v11.3.0/bin/node" "/home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc"

gyp ERR! cwd /home/akshay/.nvm/versions/node/v11.3.0/lib/node_modules/composer-cli/node_modules/grpc

gyp ERR! node -v v11.3.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/akshay/.npm/_logs/2018-11-29T02_27_29_404Z-debug.log

As you are using nvm which is the recommended way to manage node, its easy to switch to a different version of node, issue the following commands

nvm install 8

nvm use 8

Now install composer as normal.

Remove the node completely of current version and and try to install node 8.x version.

for remove node version refer this: remove node completely

for install node 8.x version:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

sudo apt-get install -y nodejs

And then try to install npm install -g composer-cli@0.19

Just reinstall npm

sudo npm uninstall npm -g
sudo apt update
sudo apt intall npm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM