Error "bcrypt is not defined" after clicking submit button in the registration page 1


This error occurs if bcrypt library is not installed and it's missing from the node_modules library, but still, you are using bcrypt while registration to hash the plain password.

You can solve it by installing bcrypt and fetching its library to your backend file.

 

Step 1:

Install bcrypt to your project by running the following command in your project terminal:

 

 

npm install --save bcrypt

or 

npm i --save bcrypt

 

Now import the bcrypt module in the backend node js file using:

 

 

const bcrypt = require('bcrypt');

 

Hope it resolved the error!