if(err) throw err; Error: Illegal arguments: string, undefined
问题 I now have module.exports.comparePassword = function(candidatePassword, hash, callback) { console.log(candidatePassword) console.log(hash) bcrypt.compare(candidatePassword, hash, function(err, ismatch) { if(err) throw err; callback(null, ismatch); }); } and the logs now are Server is up on port 3000 Connection has been established Sat Jan 13 2018 14:45:36 GMT+0000 (GMT): GET /users/login Sat Jan 13 2018 14:45:42 GMT+0000 (GMT): POST /users/login testing1234 undefined /Users/benbagley/Code