1

my Node.Js app has a dependency on bcrypt. It works fine on my local server, but when I closed the repository to WebFaction servers, bcrypt doesn't seem to want to install (or compile?) there.

I tried both npm install

(it's listed in packages.json dependencies) and also

npm install bcrypt

But none of this worked and I'm getting the following kind of error:

make: Entering directory 
`/home/noduslabs/webapps/infranodus/infranodus/node_modules/bcrypt/build'  
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
../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value><unnamed>::GenerateSalt(const         
v8::Arguments&)’:
../src/bcrypt_node.cc:257: error: invalid conversion from ‘void (*)(uv_work_t*)’ to ‘void     
(*)(uv_work_t*, int)’

[...]

make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
make: Leaving directory     
`/home/noduslabs/webapps/infranodus/infranodus/node_modules/bcrypt/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2

I also tried to install a new version of node-gyp on the server running npm -g install node-gyp

But it didn't work.

Support is not responding.

I ask for your help.

Thank you!

Aerodynamika
  • 7,883
  • 16
  • 78
  • 137
  • Check your node.js and npm version. Update if it is old. – vinayr Mar 12 '14 at 23:16
  • Possible duplicate of [Error installing bcrypt with npm](http://stackoverflow.com/questions/29320201/error-installing-bcrypt-with-npm) – kenorb May 06 '16 at 13:21

1 Answers1

1

Ok, so as nobody had the solution, I'll post one myself: the best scenario in my case was to install another module: bcrypt-nodejs.

The only problem with it is that it's about 3 times slower than bcrypt (see benchmarks here) but as I only used it for login and registration, it's still fine for me.

Regarding my problem with bcrypt, it's actually a problem with the package, some possible solutions are here: https://github.com/ncb000gt/node.bcrypt.js/issues/90.

Another solution is to try building the package without npm:

Cannot install bcrypt node.js module on Centos Server

Community
  • 1
  • 1
Aerodynamika
  • 7,883
  • 16
  • 78
  • 137