Joi.validate is a not function解决办法及最新joi验证方法

使用Joi.validate()方法报错:Joi.validate is not a function的原因是因为这个方法已经被joi弃用了,有两种解决方法

  1. 把最新版本的joi卸载,下以前的joi版本
    npm uninstall joi
    npm install [email protected]
  2. 使用最新方法
    Joi.validate is a not function解决办法及最新joi验证方法
    Joi.validate is a not function解决办法及最新joi验证方法
    我这里是博客项目其中一个验证js,你们用的时候千万不要忘记方法前加async,验证代码前加上await
    里面的验证规则和Joi.validate()一样

相关文章:

  • 2022-12-23
  • 2022-02-15
  • 2022-01-15
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-09-29
  • 2021-08-08
相关资源
相似解决方案