0

i want to use the express-validator in my project .

i require the const expressValidator = require('express-validator') and i using that like this :

app.use(expressValidator())

but when i run the project it show me this error :

app.use(expressValidator()) ^

TypeError: expressValidator is not a function

Whats the problem ? how can i solve this problem ???

mr coder
  • 199
  • 2
  • 14
  • 1
    Do you just require the actual lib? According to the docs, you need to do it in another way: https://express-validator.github.io/docs/ – max May 25 '20 at 07:00
  • 1
    Might be duplicate of https://stackoverflow.com/questions/56733975/express-validator-error-expressvalidator-is-not-a-function – Yogesh Aggarwal May 25 '20 at 07:59

0 Answers0