Invalid ELF header caused by bcrypt

I followed this solution:

bcrypt is breaking my meteor application, how to fix it?

But I still get this error:

/home/kaleobox/bundle/programs/server/node_modules/fibers/future.js:245 throw(ex); ^ Error: /home/kaleobox/bundle/programs/server/npm/npm-bcrypt/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 (/home/kaleobox/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/node_modules/bindings/bindings.js:74:15) at Object.<anonymous> (/home/kaleobox/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/bcrypt.js:3:35) 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) 

I went into /home/kaleobox/bundle/programs/server/node_modules and did:

rm -R /home/kaleobox/bundle/programs/server/node_modules/bcrypt

then

npm install bcrypt

but the error above persists. Line

/home/kaleobox/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header

tells me that I may have to uninstall and reinstall bcrypt in a second location?

+7
ubuntu meteor
source share
3 answers

You must reinstall bcrypt from

/ home / kaleobox / package / programs / server / NMP / NMP-Bcrypt / node-modules

instead

/ home / kaleobox / package / program / server / node_modules

+4
source share

I solved this problem by reinstalling the bcrypt package in the directory below:

  • Access to this directory:

    /my_app/programs/server/npm/npm-bcrypt/

  • Then run npm install bcrypt

  • Launch the application again. That should be good. :)

+1
source share

As @ lingxiao-sun's answer indicates, you may find that copying bcrypt to /home/kaleobox/bundle/programs/server/node_modules in /home/kaleobox/bundle/programs/server/npm/npm-bcrypt/node-modules this problem.

Perhaps this is due to the fact that bcrypt in <your project>/bundle/programs/server/node_modules will be created / installed locally on the host machine, whereas bcrypt in /server/npm/npm-bcrypt/node-modules/ , most likely it will be from the source machine / assembly, and if these environments it can cause problems due to the specific binaries needed for each environment.

0
source share

All Articles