redis/hiredis-node

npm install hiredis --save make error

blueforest opened this issue · 2 comments

when I run npm install hiredis --save some error happen:

> hiredis@0.4.1 install /Users/blueforest/ais-ued-pushcenter/node_modules/hiredis
> node-gyp rebuild

  CC(target) Release/obj.target/hiredis-c/deps/hiredis/sds.o
  CC(target) Release/obj.target/hiredis-c/deps/hiredis/read.o
  LIBTOOL-STATIC Release/hiredis-c.a
  CXX(target) Release/obj.target/hiredis/src/hiredis.o
  CXX(target) Release/obj.target/hiredis/src/reader.o
  SOLINK_MODULE(target) Release/hiredis.node
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/hiredis.node] Error 1
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/tnpm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/tnpm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/blueforest/ais-ued-pushcenter/node_modules/hiredis
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm ERR! Darwin 14.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/lib/node_modules/tnpm/node_modules/.bin/ali-npm" "--no-proxy" "--disturl=http://npm.taobao.org/mirrors/node" "--userconfig=/Users/blueforest/.tnpmrc" "--registry=http://registry.npm.alibaba-inc.com" "--node-gyp=/usr/local/lib/node_modules/tnpm/node_modules/node-gyp/bin/node-gyp.js" "--cache=/Users/blueforest/.tnpm" "install" "hiredis" "--save"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.2
npm ERR! code ELIFECYCLE

npm ERR! hiredis@0.4.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the hiredis@0.4.1 install script 'node-gyp rebuild'.
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! Please include the following file with any support request:
npm ERR!     /Users/blueforest/ais-ued-pushcenter/npm-debug.log

ld: library not found for -lgcc_s.10.5

Looks like your dev tools are not set up correctly.

I am having the same issue ... I discovered that i did not have Xcode installed (but rather a beta version) nor command line tools. I am installing those now and will [ npm install ] again.

Check if Xcode Command Line Tools is installed

(via terminal)

$ xcode-select -p

Install

Xcode App

App Store > (search "Xcode") > Download Xcode 7

Xcode commnad line tools
(via terminal)

$ xcode-select --install

Switch Xcode path

(via terminal)

$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Test install

(via terminal)

$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

Re-run npm install

(via terminal, in project directory)

$ rm -rf node_modules
$ npm install

Issue resolved for me.