Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error in installing hiredis through npm

I am trying to install hiredis through npm and it is giving error as

  npm  install hiredis redis

  npm http GET https://registry.npmjs.org/redis
  npm http GET https://registry.npmjs.org/hiredis
  npm http 304 https://registry.npmjs.org/hiredis
  npm http 304 https://registry.npmjs.org/redis
  npm http GET https://registry.npmjs.org/bindings
  npm http 304 https://registry.npmjs.org/bindings

  > [email protected] install /home/mohit/node_modules/hiredis
  > node-gyp rebuild

  make: Entering directory `/home/mohit/node_modules/hiredis/build'
  CC(target) Release/obj.target/hiredis/deps/hiredis/hiredis.o
  CC(target) Release/obj.target/hiredis/deps/hiredis/net.o
  CC(target) Release/obj.target/hiredis/deps/hiredis/sds.o
  CC(target) Release/obj.target/hiredis/deps/hiredis/async.o
  AR(target) Release/obj.target/deps/hiredis.a
  COPY Release/hiredis.a
  CXX(target) Release/obj.target/hiredis/src/hiredis.o
  make: g++: Command not found
  make: *** [Release/obj.target/hiredis/src/hiredis.o] Error 127
  make: Leaving directory `/home/mohit/node_modules/hiredis/build'
  gyp ERR! build error 
  gyp ERR! stack Error: `make` failed with exit code: 2
  gyp ERR! stack     at ChildProcess.onExit     
  (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
  gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
  gyp ERR! System Linux 3.2.0-23-generic
  gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-        
  gyp.js" "rebuild"
  gyp ERR! cwd /home/mohit/node_modules/hiredis
  gyp ERR! node -v v0.10.28
  gyp ERR! node-gyp -v v0.13.0
  gyp ERR! not ok 
  npm ERR! [email protected] install: `node-gyp rebuild`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the [email protected] install script.
  npm ERR! This is most likely a problem with the hiredis package,
  npm ERR! not with npm itself.
  npm ERR! Tell the author that this fails on your system:
  npm ERR!     node-gyp rebuild
  npm ERR! You can get their info via:
  npm ERR!     npm owner ls hiredis
  npm ERR! There is likely additional logging output above.

  npm ERR! System Linux 3.2.0-23-generic
  npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "hiredis" "redis"
  npm ERR! cwd /home/mohit
  npm ERR! node -v v0.10.28
  npm ERR! npm -v 1.4.9
  npm ERR! code ELIFECYCLE
  npm ERR! 
  npm ERR! Additional logging details can be found in:
  npm ERR!     /home/mohit/npm-debug.log
  npm ERR! not ok code 0

this may be a possible duplicate of

Hiredis installing error using NPM

but that question been not answered and is not clear

like image 614
Mohit Avatar asked May 10 '14 12:05

Mohit


1 Answers

The error seems to be finding c/c++ compiler problem.

make: g++: Command not found

It could be g++ is not installed or not in the path where make command can find.

Do "which g++" from the prompt and see where it is.

like image 66
Ben Avatar answered Sep 21 '22 15:09

Ben