folke / ultra-runner

🏃⛰ Ultra fast monorepo script runner and build tool
https://www.npmjs.com/package/ultra-runner
Apache License 2.0
1.2k stars 32 forks source link

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. #211

Open simlevesque opened 3 years ago

simlevesque commented 3 years ago

Hello, I'm running a command with ultra in 6 sub directories. I'm trying to run the following:

pwd; node -p -e "require(\'./package.json\').version"

in each subdirectory, at in serial mode (--concurrency 1).

I get this error:

(node:52735) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:52735) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:52735) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit

The script still run but it's an ugly output. I don't really understand why.

If I remove the call to pwd, there is no error, so this works: ultra --raw --concurrency 1 -r 'node -p -e "require(\'./package.json\').version"' but this does not: ultra --raw --concurrency 1 -r 'pwd; node -p -e "require(\'./package.json\').version"'

Is there some way to fix this cleanly ? Thank you !

Edit: Currently I'm using: node --no-warnings ./node_modules/.bin/ultra to get around the problem.

jeffrson commented 1 year ago

This is also an issue with our mono-repo. Any chance this will get fixed?