How to fix npm bcrypt install error
The issue that I struggled most with was installing Node js bcrypt (encryption middleware) with npm on windows. I tried almost every solution that was given by lots of people over the internet and none of them worked for me.
If you search on google for this same error then you will find out that there’s lot of people who are looking for solution to this error and there are some solutions that work for few people but I don’t know if it works for everyone. Also they are not that simple to implement or easy to begin with.
But don’t worry I have the simplest solution to this and it works flawlessly. So lets begin with how to fix this issue easily.
- First you have to do is uninstall existing bcrypt middleware and install new one called ‘ bcryptjs ’.
As you can see that the new middleware bcryptjs has installed without any errors or some weird warnings that it cannot install because of …..
2. Now that you have installed bcryptjs now its time to require it.
Here you can see that I’ve marked that bcryptjs middleware with red check mark that you have to replace with your old bcrypt require.
Here you go everything is done, All you had to do to install bcrypt without error is replace it with bcryptjs and there’s no difference between these two. Both of them work exactly the same way and I used bcryptjs myself without any errors.
So, That’s it — have fun……