Bcrypt invalid elf header when starting node application

I am working on a nodejs project for school. I could not install bcrypt with npm, so I installed bcrypt-nodejs and the project worked fine yesterday. But today, when I do the "node application", I have this error:

/.../node_modules/bcrypt/node_modules/bindings/bindings.js:79 throw e ^ Error: /.../node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at bindings (/.../node_modules/bcrypt/node_modules/bindings/bindings.js:74:15) at Object.<anonymous> (/.../node_modules/bcrypt/bcrypt.js:1:97) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) 

my package.json file looks like this:

 { "name": "Supinfarm", "version": "0.0.0", "env": { "PYTHON": "/usr/bin/python2.6" }, "dependencies": { "express": "3.1.0", "connect-flash": "*", "jade": "*", "stylus": "*", "passport": "*", "passport-local": "*", "mongoose": "*", "bcrypt": "*" } } 

I'm on Linux ubuntu 10.04 LTS I tried to find a solution on Google without success ... Can someone help me?

+45
bcrypt elf
Apr 04 '13 at 11:15
source share
1 answer

I found that bcrypt compiled on OSX will not work on Linux . In other words, if you close bcrypt compiled on your local OSX workstation and try to run the node application on your Linux servers, you will see the above error.

Solution: npm install bcrypt on Linux, check this is allowed.

Probably the best way to handle this is to exclude your node_modules in .gitignore ... and npm remotely.

+93
Dec 15 '13 at 1:30
source share



All Articles