I have just installed node and express. When I run the comman node app.js
it gives me following error.
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
/var/www/nodeexpress/nodetest1/app.js:38
console.log("Express server listening on port %d in %s mode", app.address().
^
TypeError: undefined is not a function
at Server.<anonymous> (/var/www/nodeexpress/nodetest1/app.js:38:69)
at Server.g (events.js:196:16)
at Server.EventEmitter.emit (events.js:101:17)
at net.js:1159:10
at process._tickCallback (node.js:339:11)
at Function.Module.runMain (module.js:492:11)
at startup (node.js:124:16)
at node.js:803:3
And My app.js looks like
var express = require('express')
, routes = require('./routes');
//var app = module.exports = express.createServer();
var app = express();
// Configuration
app.configure(function(){
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser());
app.use(express.session({ secret: 'your secret here' }));
app.use(app.router);
app.use(express.static(__dirname + '/public'));
});
app.configure('development', function(){
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.configure('production', function(){
app.use(express.errorHandler());
});
// Routes
app.get('/', routes.index);
app.listen(8080, function(){
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
});
It seems that express not getting initalized. My node version is v0.11.13-pre
and I hav0.11.13-pree installed express version using package.json as 3.4.4