I am getting error Cannot find module \'bcrypt\' in nodejs application
I have tried to install it using npm install bcrypt but still gett
use bcryptjs instead bcrypt this is worked for me
npm install bcryptjs --save
I'm running Ubuntu 16.04 on DigitalOcean (512 MB / 1 CPU, 20 GB SSD)
The following worked for me:
Scale your droplet up to the 1 GB RAM option ($10/mo)
Run each of the following commands (one at a time)
sudo npm install node-gyp -g
sudo apt-get install python
sudo apt-get install make
sudo apt-get install g++
Then try again with:
npm install bcrypt --save
Scale droplet back down to the 512 MB option
This worked for me:
npm install bcryptjs
Then:
npm update
Before using npm install
, change the package.json
file dependencies, i.e.
"bcrypt":"0.7.6"
to
"bcrypt":"*"
The Solution is pretty basic, I've solved this Error / Bug with the following steps:
Step 1: Uninstall the bcrypt package with this command :
npm uninstall bcrypt
Step 2: Then ReInstall it :
npm install bcrypt
Solution 1: lengthy method is : Install all dependencies first.
npm install -g windows-build-tools, npm install -g node-gyp
then, install bcrypt : npm install bcrypt
Solution 2: easy method. No dependencies installation required.
npm install bcryptjs
...You might have installed bcrypt but it seems like the installation was not successful for some reason. check the package.json file. If you cannot find bcrypt, the installtion was unsuccessful. You have to install again.
As everyone explained, it because of lack dependencies that your installation was unsuccessful. You can checkout the required dependencies in the link: https://www.npmjs.com/package/bcrypt
Note: To use bcrypt: var bcrypt = require('bcrypt'); .....
to use bcryptjs. var bcrypt = require('bcryptjs');
for reference: https://www.npmjs.com/package/bcrypt https://www.npmjs.com/package/bcryptjs