I have sth like this:
var express = require('express'),
app = module.exports = express.createServer(),
....;
app.use(express.bodyParser());
and it says that
"Object #<Server> has no method 'use'"
I've installed the express package and all the other that I need. Does anyone know how can I solve this issue? I've searched it over but I couldn't find anything about the 'use' method. Only 'on', 'connect', 'compile' and some others.
Thank you :)
You need to invoke the express function as of express 3.0. Here is an entire file that works fine.
var express = require('express');
var app = express();
app.use(express.bodyParser());
You don't have some subtle problem. You have a basic mistake and posting incomplete snippets is not going to help us point it out.