mosh-hamedani / vidly-api-node

309 stars 285 forks source link

React > Unable to add user. #8

Open naseemfico opened 5 years ago

naseemfico commented 5 years ago

I have followed full instruction and was able to add Movies and Edit them perfectly. However, when I trying ADDING (Post) user while all my configuration is perfect and according to Mosh... I keep on getting "Server responded with a status of 500 (Internal Server Error). Also on node.js command prompt screen I am getting following error.

error: bcrypt.genSalt is not a function TypeError: bcrypt.genSalt is not a function at router.post (C:\React\vidly-api-node\routes\users.js:21:29)

I user Google extention Postman and same issue there too.

However, when I added user manually in Mongodb and add same record through Vidly it caught the recod and threw User Already Exit message.

unaun commented 5 years ago

In vidly-api-node/package.json change the version of bcrypt in "^3.0.6" (last version) then run npm i

ybakhshi commented 4 years ago

@naseemfico did you resolve this issue. because i encounter the same now

tomas-levcik commented 4 years ago

unaun solution works in package.json replace bcrypt with "bcrypt": "^3.0.8", / today actual version / run npm i and everything works.