MongoDB Atlas - node:41449

Hi,
I am using “joi”: “^17.3.0”

When I use the expression (Node Mosh training):
return Joi.validate(genre, schema);

I get the error:
(node:41449) UnhandledPromiseRejectionWarning: TypeError: Joi.validate is not a function

Help me please !!!

Thank you sampreeth

function validateUser(user) {
const schema = Joi.object({
name: Joi.string().min(5).max(50).required(),
email: Joi.string().min(5).max(255).required().email(),
password: Joi.string().min(5).max(255).required(),
});

return schema.validate({
name: user.name,
email: user.email,
password: user.password,
});
}