How to fix npm bcrypt install error

Usama Tahir
2 min readMar 20, 2016

--

Here you can see lots of people are struggling with this issue

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.

Here you can see the error while installing bcrypt middleware

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.

  1. First you have to do is uninstall existing bcrypt middleware and install new one called ‘ bcryptjs ’.
Here you can see how to do multiple npm install or remove

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.

Remove the bcrypt and require bcryptjs

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……

--

--

Usama Tahir
Usama Tahir

Written by Usama Tahir

Full Stack Developer, UI/UX Designer & Digital Marketer. A writer who love to share solutions to common problems. @amjustsam

Responses (1)