imrefazekas / connect-rest

Exceptionally featureful Restful web services middleware for connect node.js
MIT License
100 stars 29 forks source link

【bug】TypeError: winston.Logger is not a constructor #45

Open breathcold opened 5 years ago

breathcold commented 5 years ago

TypeError: winston.Logger is not a constructor at Object.exports.createWinstonLogger (E:\WWW\elevator_monitor\node_modules\connect-rest\lib\logger.js:25:9) at Object.exports.createLogger (E:\WWW\elevator_monitor\node_modules\connect-rest\lib\logger.js:5:91) at Object.exports.rester (E:\WWW\elevator_monitor\node_modules\connect-rest\lib\connect-rest.js:483:18) at ConnectApp.middleware (E:\WWW\elevator_monitor\gulpfile.js:178:26) at ConnectApp.handlers (E:\WWW\elevator_monitor\node_modules\gulp-connect\index.js:189:47) at ConnectApp.run (E:\WWW\elevator_monitor\node_modules\gulp-connect\index.js:68:10) at new ConnectApp (E:\WWW\elevator_monitor\node_modules\gulp-connect\index.js:57:10) at Object.server (E:\WWW\elevator_monitor\node_modules\gulp-connect\index.js:268:11) at connectServer (E:\WWW\elevator_monitor\gulpfile.js:173:13) at bound (domain.js:301:14)

i found a solution from https://stackoverflow.com/questions/51074805/typeerror-winston-logger-is-not-a-constructor-with-winston-and-morgan

and i changed node_module/connect-rest/lib/logger.js file like this:

微信截图_20190714215235

breathcold commented 5 years ago

image

breathcold commented 5 years ago

"connect-rest": "^1.9.5",