MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 scanStop listeners added. Use emitter.setMaxListeners() to increase limit #22

I'm slightly surprised that the node stops working, but I haven't looked at the code. The message is only a warning, not an error, but there may be something that responds to it and shuts the node down. It's less likely that you are really running out of memory, because the symptoms would be worse.

The immediate problem could be fixed by doing as the message says:

(The default limit is 10 listeners, which is why the node complains when the count reaches 11.)

If the warning persists for large values of setMaxListeners, the node may not be doing its housekeeping properly and leaking memory as a result.