Skip to content

Instantly share code, notes, and snippets.

@elhoyos
Created March 10, 2014 13:29
Show Gist options
  • Select an option

  • Save elhoyos/9464937 to your computer and use it in GitHub Desktop.

Select an option

Save elhoyos/9464937 to your computer and use it in GitHub Desktop.
Fixing an EMFILE error

A quick fix

$ ulimit -n 2048

Detailed info: http://otaqui.com/blog/1618/how-to-fix-error-emfile-too-many-open-files-from-yeoman-and-npm/

Reproduce the problem

It happened to me when issued a brunch watch command from iTerm after doing it on RubyMine (w/ custom build command using brunch executable):

$ brunch w -s
10 Mar 08:17:55 - info: application started on http://localhost:3333/

path.js:309
      var path = (i >= 0) ? arguments[i] : process.cwd();
                                                   ^
Error: EMFILE, too many open files
    at Object.exports.resolve (path.js:309:52)
    at Object.realpath (fs.js:1309:18)
    at FSWatcher.exports.FSWatcher.FSWatcher._handle (/usr/local/share/npm/lib/node_modules/brunch/node_modules/chokidar/lib/index.js:209:17)
    at FSWatcher._handle (/usr/local/share/npm/lib/node_modules/brunch/node_modules/chokidar/lib/index.js:6:61)
    at /usr/local/share/npm/lib/node_modules/brunch/node_modules/chokidar/lib/index.js:193:26
    at Array.forEach (native)
    at /usr/local/share/npm/lib/node_modules/brunch/node_modules/chokidar/lib/index.js:192:14
    at Object.oncomplete (fs.js:107:15)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment