I know this might flag as a duplicate solution but solution on stack overflow is not working for me.
Problem:
(node:5716) MaxListenersExceededWarning
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message lis teners added. Use emitter.setMaxListeners() to increase limit
By default, a maximum of 10 listeners can be registered for any single event, and we got 11 Ohno
// Change to 80 or 150 whatever and see what happens
require('events').EventEmitter.prototype._maxListeners = 70;
require('events').defaultMaxListeners = 70;
process.on('warning', function (err) {
if ( 'MaxListenersExceededWarning' == err.name ) {
console.log('o kurwa');
// write to log function
process.exit(1); // its up to you what then in my case script was hang
}
});