Tag Archives: throw new TypeError(‘”listener” argument must be a function’);

TypeError: “listener” argument must be a function Error in node js eventemitter

while executing the above code it is thowing error-TypeError: “listener” argument must be a function Solution:this is because of the code executing sequence.if we use emit() function at the bottom, then eventemitter.on() and other function should be above.