express validator is not a function
See original GitHub issueI used express-validator for some of my projects, today when i installed it and i wanted to use it like this
const expressValidator = require('express-validator'); app.use(expressValidator);
i got the error “expressValidator is not a function” this is with version “6.1.1”
i installed version “5.3.1” i used before and it worked.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:24
- Comments:28 (3 by maintainers)
Top Results From Across the Web
Express Validator Error: expressValidator is not a function
Express Validator has been updated therefore, you can't use it this way This is a new way to use the express validator.
Read more >Express Validator Error: expressValidator is not a function
Learn here about how to fix the Express Validator Error: expressValidator is not a function. Resolve TypeError: expressValidator is ...
Read more >How to use Express Validator | Getting Started with Express ...
Express -validator is an express middleware that provides us with validation and sanitization functions. Actually, Express validator is built on top of ...
Read more >How to make input validation simple and clean in ... - Medium
express -validator is a set of express.js middlewares that wraps validator.js validator and sanitizer functions. The module implements five important API's:.
Read more >validationResult() - express-validator
Extracts the validation errors from a request and makes them available in a Result object. Each error returned by .array() and .mapped() methods...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With me it worked out that way:
Uninstall the current version: npm uninstall express-validator And install the older version: npm install express-validator@5.3.1
You can change or degrade the version by running this command in your root folder. npm install express-validatior@5.3.1–save-exact
No need to delete your node modules.