Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

bcrypt throws error while installing npms on Ubuntu/Debian #64

Open
Capt-Slow opened this issue Jan 12, 2017 · 1 comment
Open

bcrypt throws error while installing npms on Ubuntu/Debian #64

Capt-Slow opened this issue Jan 12, 2017 · 1 comment

Comments

@Capt-Slow
Copy link

Running npm install on Ubuntu 16.04 will throw:
npm ERR! Failed at the bcrypt@1.0.2 install script 'node-pre-gyp install --fallback-to-build'.

The workaround is to run the following before npm install:
npm install node-gyp node-pre-gyp

This will generate a warning:
npm WARN prefer global node-gyp@3.5.0 should be installed with -g

Installing globally requires sudo...

@jshimko
Copy link
Contributor

jshimko commented Jan 12, 2017

Yeah, you generally want to have node-gyp installed globally. You're almost guaranteed to need it eventually while working with Node apps.

Anyway, this is more of a warning than an error. When the correct pre-built bcrypt binary isn't available to be downloaded, it falls back to compiling the c++ code locally. The whole log output...

$ meteor npm install

> bcrypt@1.0.2 install ~/redoc/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v46-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.2 and node@4.6.2 (node-v46 ABI) (falling back to source compile with node-gyp)
  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
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9
  COPY /Users/Jeremy/code/meteor/reaction/redoc/node_modules/bcrypt/lib/binding/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp

...

Note the --fallback-to-build flag that gets used and also this line:

Pre-built binaries not found for bcrypt@1.0.2 and node@4.6.2 (node-v46 ABI) (falling back to source compile with node-gyp)

So I don't think we want to add it as a dependency on the project because you may not always need it and because you should probably have node-gyp installed globally anyway. So maybe a note at the bottom of the readme?

@machikoyasuda machikoyasuda self-assigned this Jun 27, 2017
@machikoyasuda machikoyasuda removed their assignment Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants