codeuino / social-platform-donut-backend

Donut API:
http://donut-api-prod.codeuino.org/
GNU General Public License v3.0
24 stars 57 forks source link

Switch from bcrypt to bcryptjs #202

Closed kaustubhai closed 3 years ago

kaustubhai commented 3 years ago

Switching from bcrypt to bcryptjs Bcrypt demands a lot of dependancies while bcryptjs is a javascript only enhanced version of it.

To Reproduce Steps to reproduce the behaviour:

  1. Have a fresh machine with no dependencies install
  2. Try npm install on the cloned repo and bcrypt will give an error

Console Log Output node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-linux-x64.tar.gz

ksraj123 commented 3 years ago

A comprehensive list of dependencies required by bcrypt can be found here The backend code is ultimately meant to run on the server in a Linux environment where most of these dependencies are already present. The error you have mentioned is well document in bcrypt's npm page itself here. Please make sure that you have the required dependancies installed. Since bcrypt is written in C++ it has better performance (faster) over bcryptjs written in JavaScript. Since the server side code is meant to run in Node.js only, not in the browser (where brcryptjs is used as an alternative to bcrypt) I think we would be better off tweaking our docker files and docs to ensure that we have all the dependencies.