You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MaxListenersExceededWarning when installing or creating Node.js projects on macOS #49269
I am getting the following warning message when I try to install or create Node.js projects on macOS:
(node:80101) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
I have updated Node.js to the latest version (V20.5.1) and npm was already up to date (V9.8.1). I'm not using any third-party tools, I simply use terminal.
The commands I get the warning after are: npm install ...
and npx ...
I'd appreciate if anyone can help me with this. So far i haven't noticed anything wrong in projects or installing process except the warning itself, but I don't understand why should the warning pop-up when I haven't made any changes to any configurations in NPM or node.
How often does it reproduce? Is there a required condition?
It happens every time I try to install (with NPM) or create a project (with NPX), no special condition produces it, it just comes up.
What is the expected behavior? Why is that the expected behavior?
Expected behavior is, NPM should normally just install and NPX should normally just create the project without any warnings!
What do you see instead?
The warning message before completion of install or create:
(node:80101) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
at _addListener (node:events:590:17)
at TLSSocket.addListener (node:events:618:10)
at Readable.on (node:internal/streams/readable:904:35)
at TLSSocket._wrapHandle (node:_tls_wrap:674:8)
at TLSSocket.reinitializeHandle (node:_tls_wrap:683:22)
at internalConnectMultiple (node:net:1123:30)
at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
at listOnTimeout (node:internal/timers:575:11)
at process.processTimers (node:internal/timers:514:7)
Activity
nivek3 commentedon Sep 13, 2023
I have the same issue, when I call a
httpsrequest, but only occasionally.This seems to be because the number of event listeners for
TLSSocketexceeds the default max listeners.node/lib/events.js
Line 270 in d2c7c36
process will emit warningnode/lib/events.js
Lines 585 to 592 in d2c7c36
code