Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid ELF header caused by bcrypt

I followed this solution:

bcrypt is breaking my meteor application, how do I fix it?

But Im still getting 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. The line

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

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

like image 439
redress Avatar asked Apr 08 '15 20:04

redress


2 Answers

You should reinstall bcrypt from

/home/kaleobox/bundle/programs/server/npm/npm-bcrypt/node-modules

instead of

/home/kaleobox/bundle/programs/server/node_modules

like image 140
Lingxiao Sun Avatar answered Oct 02 '22 01:10

Lingxiao Sun


I have solved this problem by re-installing the bcrypt package in the below directory:

  • Access to this directory:

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

  • Then run npm install bcrypt

  • Start your app again. It should be fine. :)

like image 37
trungvt89.it Avatar answered Oct 02 '22 02:10

trungvt89.it