简体   繁体   中英

TypeError Joi.validate is not a function

看

please help with that i am not sure what is happening im using the following:

"body-parser": "1.19.0",
"express": "4.17.1",
"joi": "17.1.1"

but it is only the joi that im having issues with

Try schema.validate instead of Joi.validate

Reference: https://joi.dev/api#example

Did you do:

const Joi = require('joi')   

at beginning of this file? Notice the capital J.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM