bithavoc / express-winston

express.js middleware for winstonjs
https://www.npmjs.com/package/express-winston
MIT License
796 stars 187 forks source link

Error with Winston 3 ::: TypeError: winston.Logger is not a constructor #196

Closed nagapavan closed 5 years ago

nagapavan commented 5 years ago

Seeing following error after upgrading to Winston 3.1 and express-winston 2.6.0

TypeError: winston.Logger is not a constructor at Object.logger (/path/test-service/node_modules/express-winston/index.js:190:59)

The source code that's causing the problem: index.js:190

    options.winstonInstance = options.winstonInstance || (new winston.Logger ({ transports: options.transports }));

Usage in Code:

expressWinston.logger(requestLoggerOptions)

Package Versions:

"express-winston" : "2.6.0",
"winston" : "3.1.0",
nagapavan commented 5 years ago

Apologies. Just realised there is a newer express-winston version 3.0.1. Closing this off. Sorry for spamming.