I recently implemented winston-elasticsearch on my express server by following the code provided in the documentation
var winston = require('winston');
var Elasticsearch = require('winston-elasticsearch');
var esTransportOpts = {
level: 'info'
};
var logger = winston.createLogger({
transports: [
new Elasticsearch(esTransportOpts)
]
});
Upon starting the server, I encountered the following error:
TypeError: Elasticsearch is not a constructor
Both the "winston" and "winston-elasticsearch" packages are up-to-date with versions "^3.2.1" and "^0.8.8", respectively.