Node.js-Chat icon indicating copy to clipboard operation
Node.js-Chat copied to clipboard

Express version 4 does not support function "configure"

Open redhat-raptor opened this issue 10 years ago • 1 comments

Getting this error:

app.configure(function() { ^ TypeError: Object function (req, res, next) { app.handle(req, res, next); } has no method 'configure'

This is because Express version 4 does not support "configure" function: http://stackoverflow.com/questions/22202232/express-has-no-method-configure-error

However package.json has hard-coded express dependency: "express": "*" which is causing express version 4 to download. Express version 3 works fine!

redhat-raptor avatar Dec 21 '14 15:12 redhat-raptor

To get it to work with Express 4, just change

app.configure(function() {
    app.use(express.static(__dirname + '/public'));
});

to be

app.use(express.static(__dirname + '/public'));

krisdahl avatar Jan 03 '15 00:01 krisdahl