Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crashes with "EMFILE: too many open files" on large projects

See original GitHub issue

My project has 35,085 files in 3,652 directories. When I load the web interface, it fails with:

Error: EMFILE: too many open files, open '/usr/local/lib/node_modules/codecrumbs/node_modules/watchpack/lib/DirectoryWatcher.js'
    at Object.openSync (fs.js:448:3)
    at Object.readFileSync (fs.js:348:35)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:809:20)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Module.require (internal/modules/cjs/loader.js:705:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at WatcherManager.getDirectoryWatcher (/usr/local/lib/node_modules/codecrumbs/node_modules/watchpack/lib/watcherManager.js:14:25)
    at WatcherManager.watchDirectory (/usr/local/lib/node_modules/codecrumbs/node_modules/watchpack/lib/watcherManager.js:32:14)

macOS 10.14.3 Node 11.11.0 codecrumbs 0732382

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

alltomcommented, Mar 20, 2019

It’s actually a Go project, for the most part. (I cloned the Java support files to add Go support. 😃

The biggest chunk of files, though, is a sub-directory containing a third party library I included in my project that has code in a variety of languages. I could easily exclude that if there were a command-line flag for it. The only directory in there that looks like codecrumbs could ignore as a rule is a Python site-packages directory.

Bogdan-Lyashenkocommented, Jul 29, 2019

Sorry, didn’t really have time to look at this, was working on other features 😃 just so you know, there is -x CLI parameter (see readme for details) you can use to exclude folders you don’t need (so there are less files)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: EMFILE: too many open files - React Native CLI
On Windows the project was working perfectly but in Mac, after a few seconds of running the project with npm start, it crashed...
Read more >
Fix 'EMFILE: too many open files' error in Jest -
When trying to run Jest in watch mode, this error may mean that you are missing a dependency.
Read more >
error: emfile: too many open files open node js
Trying to build + test a huge project on Windows 10 x64. Fails with 'too many open files'. This should not happen. Works...
Read more >
"EMFILE: too many open files" after upgrading to 0.15.6
Alas, I can't paste the debug info because I can't start the Obsidian – it hangs with the error message. WhiteNoise July 15,...
Read more >
iOS : React Native Error: EMFILE: too many open files, watch
iOS : React Native Error: EMFILE : too many open files, watch [ Beautify Your Computer : ] iOS ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found