简体   繁体   中英

BCrypt on WebFaction Node.Js doesn't install

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM