以下代码向我显示了错误:
TypeError:'instanceof' 的右侧不可调用
es6-promisify
图书馆似乎有问题
const {promisify} = require("es6-promisify");
exports.register = async (req, res, next) => {
const user = new User({ email: req.body.email, name: req.body.name });
const register = promisify(User.register, User);
await register(user, req.body.password);
res.send("all has been saved")
next(); // pass to authController.login
};