0

I see the following errors when run command npm install -g [email protected]

nvm 0.33.0

npm 6.4.1

node 10.13.0

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

https://hyperledger.github.io/composer/latest/installing/development-tools.html

here's the error part:

[email protected] 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 [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Pre-built binaries not installable for [email protected] and [email protected] (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 [email protected]~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 [email protected]~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! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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

2 Answers 2

4

This is because node has just released node 10 as lts and the prereqs-ubuntu.sh script installs the lts version of node so you are now getting node 10.

It's easy to fix, just before installing composer just run the following commands

nvm install 8
nvm use 8

this will install node 8 and then you are ready to install composer.

0
2

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

Just follow the steps written below:

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
....

And then install the desired version:

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

Now you can install composer-cli.

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

2
  • Actually running with sudo made things a lot easier for me. Commented Jul 30, 2019 at 9:00
  • @ShwetaGupta composer-tools installation with sudo can cause problem. Commented Jul 31, 2019 at 4:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.