Hi,
when i run npm install and run my project, it doesn't install bcrypt whereas all other dependencies are installed.
module.js:557
throw err;
^
Error: Cannot find module 'E:*node_modulesbcrypt\lib\bindingbcrypt_lib.node'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
You need to compile the module. Run npm rebuild bcrypt
I tried several ways, not the one you mentioned above. But after all failures, i downgrade node to 8.9.3 version and npm to under 5. Then delete all node modules and first install bcrypt and then install all other modules. That trick did work.
NodeJS 9 and npm have weird issues. Please stick to NodeJS 8 till all of them are resolved.
it don't work in nodejs 9 use 8 is the answer - no that is not an answer that's excuse.
@alexmac131 I understand your frustration, but sometimes npm breaks after new Node releases and all we can do is wait for them to fix it.
Good news it bcrypt now works fine with NodeJS 9 and the latest version of NPM. We also have published the pre-built binaries for Linux and macOS.
Solution change from bcrypt to bcryptjs - working
If you want to block your event loop, then yes
Most helpful comment
You need to compile the module. Run
npm rebuild bcrypt