1

I'm trying to use this module:

https://www.npmjs.com/package/express-formidable

but when I launch my app terminal returns:

app.use(formidable());
        ^

TypeError: formidable is not a function

why?

1
  • Can you show some code how you require the module?
    – Molda
    Commented Oct 13, 2016 at 9:57

2 Answers 2

1

You need to add formidable to your app after you are done installing it with npm i -S express-formidable

Copy paste from the readme,

const express = require('express');
const formidable = require('express-formidable');

var app = express();

app.use(formidable());
1
  • Really I added firstly formidable and then express-formidable :-) how ever I resolved reinstall all modules that I use on my app ... perhaps some incompatibility between old nodue_modules folder and the new one! Commented Oct 13, 2016 at 12:18
1

I resolve reinstalling the moduels that I have on my app. I did also a clean on my package.json so now works correctly!

Here its are the two parts of my package that I change:

old: "dependencies": { "base64url": "^2.0.0", "body-parser": "1.9.2", "compression": "^1.6.2", "connect": "^3.5.0", "connect-redis": "^3.1.0", "cookie-parser": "^1.4.3", "crypto": "0.0.3", "express": "4.10.1", "express-formidable": "^0.1.3", "express-session": "^1.14.1", "formidable": "^1.0.17", "fs-extra": "^0.30.0", "helmet": "^2.1.3", "jwt-simple": "~0.5.0", "morgan": "1.5.0", "multer": "^1.2.0", "mysql": "^2.9.0", "path": "^0.12.7", "router": "^1.1.4", "time": "^0.11.4" }

and the new one:

"dependencies": { "base64url": "^2.0.0", "body-parser": "^1.15.2", "compression": "^1.6.2", "cookie-parser": "^1.4.3", "express": "^4.14.0", "express-formidable": "^1.0.0", "express-session": "^1.14.1", "fs-extra": "^0.30.0", "helmet": "^2.3.0", "morgan": "^1.7.0", "mysql": "^2.11.1" }

perhaps there is some incompatibility between the modules ...

Not the answer you're looking for? Browse other questions tagged or ask your own question.