function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Caleb Kuester 27Caleb Kuester 27 

SFDX Error on sfdx force:source:pull/push

Hey guys: I'm getting an error on my scratch org when I run the force:source:pull/push commands on my Mac terminal.

The error is: 

(node:1196) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 response listeners added. Use emitter.setMaxListeners() to increase limit


  • It happens in a brand new scratch org that I created for troubleshooting this issue.
  • It happens after uninstalling/reinstalling SFDX
  • It happens when I install using npm.
  • At some point in my scratch org, I noticed a "Logged in too many times" error, so upon checking my login history for one attempt, I get 75 login attempts within a minute's timeframe.

This started happening fairly recently, as I have been working in my scratch org for the past month. It only started yesterday.

It doesn't happen when I run sfdx force:org:list. I get the expected list of several orgs.

Has anybody else come across this?

karthikeyan perumalkarthikeyan perumal

You need to add the Infinity to your gulp file  like below, 
require('events').EventEmitter.defaultMaxListeners = Infinity;

hope this will help you. 


Caleb Kuester 27Caleb Kuester 27
My question is that, since this situation is actually caused by sfdx accessing my scratch org an obscene number of times for no known reason, wouldn't changing the number of times it can create a listener just create a different problem?

I expect that it will not generate this error, but either a different error will be generated, or it will just hang there. A standard sfdx push/pull should not be attempting to access the scratch org 75 times (and increasing the longer I let the command hang in the terminal).

I also don't have a gulpfile.js. This is just a process of deploying between local code changes and a scratch org and vice versa.
Caleb Kuester 27Caleb Kuester 27


I uninstalled the JRE for Java 8 and it worked.