question-mark
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.

Error: EMFILE on OSX when requiring lots of files

See original GitHub issue

When requiring 256 files from a single file on OSX browserify throws:

Error: EMFILE, open '/Users/karl/Sites/KVP/GuruFramework/package.json'

From Googling around it looks like this is caused by attempting to open too many files in parallel.

It looks like this could be solved by using the graceful-fs module to limit the number of files opened in parallel.

https://github.com/isaacs/node-graceful-fs

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:32 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
karlcommented, Jun 18, 2013

As a work around I have upped the file limit for my user by adding this to ~/.bash_profile

# Work around bug in browserify
ulimit -n 2560
0reactions
ViktorHofercommented, Jul 17, 2016

I’m already using npm 3… And with modules I ment application entry points => bundles for browserify. The problem is that I’M creating multiple bundles at the same time. I need to implement some kind of scheduler which watches over it and limits it e.g. to 5 parallel browserify bundlings…

Read more comments on GitHub >

github_iconTop Results From Across the Web

NodeJS error "EMFILE, too many open files" on Mac OS
Your code is opening too many files. By default, OS X has a limit of 256 simultaneously opened files. When your code requires...
Read more >
EMFILE: too many open files, uv_cwd in Mac OS - Anna Coding
The solution to solve update error: EMFILE: too many open files, uv_cwd in Mac OS.
Read more >
Is there a fix for the "Too many open files in system" error on ...
I applied all the below limit increases but they didn't help immediately. I am running command line phpUnit tests > selenium server >...
Read more >
Fix 'EMFILE: too many open files' error in Jest - SeanMcP.com
When trying to run Jest in watch mode, this error may mean that you are missing a dependency.
Read more >
NodeJS error "EMFILE, too many open files" on Mac OS-node.js
[Solved]-NodeJS error "EMFILE, too many open files" on Mac OS-node.js ... You need to reinstall watchman and make sure that brew's version is...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found