browserify: Error: EMFILE on OSX when requiring lots of files

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

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 32 (3 by maintainers)

Commits related to this issue

Most upvoted comments

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