node.bcrypt.js: Failed at the bcrypt@0.8.7 install script 'node-gyp rebuild'

I got an error after running meteor npm install --save bcrypt

> bcrypt@0.8.7 install /folder/to/meteor/app/node_modules/bcrypt
> node-gyp rebuild

  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/bcrypt_lib.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/bcrypt_lib.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/folter/to/.meteor/packages/meteor-tool/.1.4.1.cbldeg++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/node-gyp/lib/build.js:276: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.5.0
gyp ERR! command "/folder/to/.meteor/packages/meteor-tool/.1.4.1.cbldeg++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node" "/folder/to/.meteor/packages/meteor-tool/.1.4.1.cbldeg++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /folder/to/Meteor/client-portal-v2/node_modules/bcrypt
gyp ERR! node -v v4.5.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
npm ERR! Darwin 14.5.0
npm ERR! argv "/folder/to/.meteor/packages/meteor-tool/.1.4.1.cbldeg++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node" "/folder/to/.meteor/packages/meteor-tool/.1.4.1.cbldeg++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm" "install" "--save" "bcrypt"
npm ERR! node v4.5.0
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE

npm ERR! bcrypt@0.8.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bcrypt@0.8.7 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt 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 information on how to open an issue for this project with:
npm ERR!     npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15

Most upvoted comments

This fixed the issue for me npm install -g node-gyp

there’s no issue when I’m using node 8 but it is on node 11

Depending on your platform, you need to be able to run node-gyp with the instructions at: https://github.com/nodejs/node-gyp

i installed gyp:

npm install -g node-gyp

then did

node-gyp rebuild

and then faced other problem:

gyp info spawn args   '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: /Users/miukki/Sites/winery) while trying to load binding.gyp

I had the same issue on Arch Linux, I solved it by downgrading nodejs from 6.5.0 to 6.4.0

I had similar issue when installing accounts-password package via meteor add accounts-password.

Successfully installed the package by first installing npm-bcrypt package via meteor add npm-bcrypt and then installing accounts-password package via meteor add accounts-password.