当我通过 nodemon 运行此代码时出现问题,它给了我以下错误
app.post('/register',async (req,res)=>{
try {
const hashedPassword =await bcrypt.hash(req.body.password,10);
users.push({
id: Date.now().toString(),
name: req.body.name,
email:req.body.email,
password:hashedPassword
});
res.redirect('/login')
}
catch {
res.redirect('/register')
}
console.log(users)
`});``