VishalPandita
VishalPandita

Reputation: 700

Problem in installing npm install -g composer-cli in ubuntu 16.04

Hi I am trying to install composer-cli using npm but it is throwing error. the log of the error is as below:

18988 error code ELIFECYCLE
18989 error errno 1
18990 error [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
18990 error Exit status 1
18991 error Failed at the [email protected] install script.
18991 error This is probably not a problem with npm. There is likely additional logging output above.
18992 verbose exit [ 1, true ]

I tried every possible way to fix this issue. but couldn't find any solution.

Please let me know how to fix the issue.

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: [email protected] (node_modules/composer-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

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!     /home/dspl_user/.npm/_logs/2018-09-27T13_11_13_477Z-debug.log

Upvotes: 1

Views: 330

Answers (2)

Nandit Mehra
Nandit Mehra

Reputation: 346

i resolved the same problem on my Ubuntu 18.04 machine by =>

Installing pre-requisites at https://hyperledger.github.io/composer/latest/installing/installing-prereqs.html

which says->

curl -O https://hyperledger.github.io/composer/latest/prereqs-ubuntu.sh

then

chmod u+x prereqs-ubuntu.sh

and at last =>

./prereqs-ubuntu.sh

then restart your terminal and try the installation =>

npm install -g [email protected]

without su or sudo. I hope this helps :):)

Upvotes: 1

IanClark
IanClark

Reputation: 1

I think I had the same error as you. It's working for me now after switching to Node 8.9.0. It looks like you're using Node v10, which is not supported for hyperledger fabric.

Upvotes: 0

Related Questions