Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
OS X: "Error: EMFILE: too many open files, watch" when running tests #4540
Is this a bug report?
Maybe. This may well not be a
Steps to Reproduce
Tests are executed.
I've tried first raising the limit of open files to 65536, but still get the above error:
Any ideas on how to work around this? Thanks!
Machines vary, but there is a limit to the number of open files (because of how it watches, more on that later) -- if you use
Lots of people don't hit this until they start depending on a ton of dependencies, which is why there's not many issues about it.
Watchman is specially designed to watch arbitrarily large number of files without issue, and people normally install it by the time their applications grow to such a large size because Jest recommends it in the docs somewhere iirc.
Anyway, the important part of the backstory is that newer versions of Jest watch files differently now to prevent this issue, and that version is available in the 2.0 beta.
1.0 is using an older version of Jest which a patch-release isn't going to be cut for.