I am getting error Cannot find module \'bcrypt\' in nodejs application
I have tried to install it using npm install bcrypt but still gett
The problem could be because there is no this essential
sudo apt-get install -y build-essential python
Then agregate bcrypt
with
if you're using npm:
npm install bcrypt
npm rebuild
or if you're using yarn:
yarn add bcrypt
yarn install
yarn build
If the problem could not solved after applying the workarounds above, you may try to update version in package.json
as mentioned on [Fix bug] update bcrypt to 3.0.7
Hope this helps.
I followed some course, and for me it didn't work. My mistake was:
var bcrypt = require('bcrypt.js');
But when I changed it to
var bcrypt = require('bcryptjs');
It worked!
Using npm install bcrypt
command can't resolve the issue for me.
I tried the commands below and my issue resolved.
npm install node-gyp -g
npm install bcrypt -g
npm install bcrypt --save
I can't run any npm commads. so, I download from this link https://github.com/kelektiv/node.bcrypt.js
create folder bcrype and use it.
Solve now.
First check node-modules folder for a folder with this name bcrypt
. If it exists with another name just rename it; for example bcrypt-pbkdf
must be edited to bcrypt
. If there isn't such a folder, do this in cmd:
npm install node-gyp -g
# bcrypt reqired node-pre-gyp
npm install -g node-pre-gyp
npm install bcrypt -g
npm install bcrypt --save