0

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

Taher A. Ghaleb
  • 5,120
  • 5
  • 31
  • 44

3 Answers3

1

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.

david_k
  • 5,843
  • 2
  • 9
  • 16
0

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

Mahesh Rajput
  • 276
  • 1
  • 12
  • Sorry, but this is not the recommended way for people to install node for composer. We explicitly state that node should not be installed using sudo as it makes things more difficult. – david_k Nov 29 '18 at 10:10
  • Brother, I just follow instruction from this Linux forum : https://linuxconfig.org/how-to-install-node-js-on-ubuntu-18-04-bionic-beaver-linux – Mahesh Rajput Nov 29 '18 at 12:28
  • @david_k Installing with sudo made things easier for me – Shweta Gupta Jul 29 '19 at 13:25
0

Just reinstall npm

sudo npm uninstall npm -g
sudo apt update
sudo apt intall npm
Sabit Rakhim
  • 460
  • 3
  • 12