node --version v0.10.26
npm --version 1.4.3
I followed this: http://expressjs.com/guide.html
which has this code
var express = re
Most middleware (like logger) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware
express.logger('dev') is removed from express module.
use logger like morgan.
var morgan = require("morgan");
app.use(morgan('combined'));
for more details on morgan checkout the below link morgan
The first line tells it all:
Error: Most middleware (like logger) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
Looking at https://github.com/senchalabs/connect#middleware we can see that express.logger
has been replaced with morgan.
var logger = require('morgan');
app.use(logger); //replaces your app.use(express.logger());
Remember to npm install morgan
and/or add it to your package.json
I faced the same problem. I ran the below from the directory where my node js file was
npm install --save morgan
Using above command adds the dependency to your package.json.
Once package added, logger can now be used as
logger = require('morgan');
app.use(logger('dev'));
You need a previous version:
npm install express@3.0.0