here is my complete code
var express = require(\'express\'),
app = express(),
mongoose = require(\'mongoose\'),
bodyParser = require(\'body-parse
I also encountered the same error when I was using
bcrypt.compareSync("input to be compared with the hash", hash)
.
Later on I discovered that I was supposed to pass the actual value in the first input parameter i.e (The actual value from which the hash was generated) and the hash in the second input parameter, but I was passing hashed values in both the input parameters.
After correcting the same it was giving me the desired output as true or false.
You can also run and check your code here.