I am getting error Cannot find module \'bcrypt\' in nodejs application
I have tried to install it using npm install bcrypt but still gett
Using npm install bcrypt
command can't resolve the issue for me.
finally, i fixed commands below and my issue resolved.
npm install node-gyp -g
# bcrypt reqired node-pre-gyp
npm install -g node-pre-gyp
npm install bcrypt -g
npm install bcrypt --save
node -v v8.16.1
npm -v 6.4.1
I was using bcrypt@3.0.6
and @types/bcrypt@3.0.0
with node 13.7.0
environment. I was running into error cannot find binding .../node_modules/../bindings/bcrypt_lib.node
I ran this to resolve issue:
npm i -g node-gyp
npm i bcrypt --save
This upgraded to bcrypt@3.0.8
I had the same issue, after I installed the bcrypt particular version depends on your node version, it started to working.
In my case my nodeJS version was 12.3.0 , so I installed by specifying the version " npm install bcrypt@3.0.6."
I hope it will resolve the issue.
It seems that bcrypt was depreciated at version 1.0.3 as it was susceptible to a wrap-around bug. NPM recommends installing version 2.0.0.
So, if you wish to save it, just run the command:
npm install bcrypt@2.0.0 --save
First delete bcrypt module from your node modules. Then try the below steps:
1) npm install node-gyp -g
2) npm install bcrypt -g
3) npm install bcrypt -save
This will definitely resolve the issue.
For me the issue resolved by below steps: Nothing above solved my issue, 1) rm -rf node_modules in your project directory 2) rm package-lock.json 3) just check you have your package.json file now 4) npm install
Thats it, you will get bcrypt installed properly. Hope this helps.