这个函数有什么问题(表达 4.16.0,TypeError: req.assert is not a function):
userController.signupPost = function(req, res, next) {
console.log(req.body);
var express=require('express');
var validator = require('express-validator');
var app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(validator())
req.assert('name', 'Name cannot be blank').notEmpty();
req.assert('email', 'Email is not valid').isEmail();
req.assert('email', 'Email cannot be blank').notEmpty();
req.assert('password', 'Password must be at least 4 characters long').len(4);
req.sanitize('email').normalizeEmail({ remove_dots: false });
}