Error: Error watching file for changes: EMFILE
See original GitHub issueHello, Extension shows error at output:
pure node --harmony
project, no babel anywhere, npm test
= node --harmony node_modules/.bin/jest
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Error watching file for changes: EMFILE #3436 - facebook/jest
I know others have posted this issue, but it seems that they are aging and using old versions. I have tried everything from...
Read more >Testing with Jest failed with Error: Error watching file for changes
Oh, I am going to answer my question after hours of my struggling. The best solution is to install the latest version of...
Read more >Testing with Jest failed with Error: Error watching file for changes
Oh, I am going to answer my question after hours of my struggling. The best solution is to install the latest version of...
Read more >Error on running IOS App (Example) | Treehouse Community
Collaborate here on code errors or bugs that you need feedback on, ... Error: Error watching file for changes: EMFILE at _errnoException ......
Read more >Fix 'EMFILE: too many open files' error in Jest - SeanMcP.com
Why watchman ? ... Watchman is a file-watching service from Facebook that will respond to changes in your files. Jest (also by Facebook)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like I’ve solved this for myself, for now, after reading many of the conflicting reports that
watchman
orfb-watchman
being installed, or not installed I’ve not touched any of that for fear of perpetuating that side of things.Anyways, I had tried removing
node_modules
and reinstalling, that worked once or twice, I restarted the Finder app, because, open files, again this issue kept reappearingNext I thought that Jest was trying to watch all the files in
/node_modules
, wondering if like much of these tools they will inherit the ignore path from the.gitignore
, went looking at the docs and no mention of Jest doing that.Side Note: I believe
testPathIgnorePatterns
ignores/node_modules
by defaultThus I tried adding
/node_modules
towatchPathIgnorePatterns
Yup, this now works for me, consistently, with this not set Jest fails to start in watch mode, setting this Jest will start and restart in watch mode successfully
The above is in my
package.json
file, I’ll try updating it in some Jest config files and shared configs a bit laterThere’s a few Jest issues that state the above works as a workaround but not the ideal solution, it was supposedly fixed in Jest 24.8.0, but not for everyone and the above workaround is still required
So whilst the above works, the consensus appears to be that this is not the “right” solution, if you’ve complex projects this wouldn’t be ideal, so for now, this will work for me and I’ll keep an eye on the above linked Jest issue
The easiest thing would be to install Watchman:
If you don’t have brew, do this first:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"