jung command fails on large directories on Mac OS X
This was tested on Mac OS X "Mavericks" on an rMBP (15-inch Early 2013).
Seemingly when working with large directories, jung will fail. I'm assuming it's large directories, because it will work fine with a directory with one or two files in it, but for my actual use-case, it fails. To replicate, perform the following:
npm install -g sails
sails new testproject --linker
cd testproject
npm install
jung -- cat package.json
This will fail with the following:
fs.js:1051
throw errnoException(process._errno, 'watch');
^
Error: watch EMFILE
at errnoException (fs.js:1019:11)
at FSWatcher.start (fs.js:1051:11)
at Object.fs.watch (fs.js:1076:11)
at initWatcher (/usr/local/lib/node_modules/jung/node_modules/watch-fs/lib/watcher.js:99:32)
at /usr/local/lib/node_modules/jung/node_modules/watch-fs/lib/watcher.js:92:9
at Array.forEach (native)
at initWatchers (/usr/local/lib/node_modules/jung/node_modules/watch-fs/lib/watcher.js:91:22)
at /usr/local/lib/node_modules/jung/node_modules/watch-fs/lib/watcher.js:241:13
at /usr/local/lib/node_modules/jung/node_modules/watch-fs/lib/watcher.js:72:9
at /usr/local/lib/node_modules/jung/node_modules/watch-fs/node_modules/async/lib/async.js:116:25
Unfortunately, it is due to a system-level limit on the number of file event watchers that can be registered, so the solution is not immediately obvious. Until I can fix it, if you don't need to watch a directory it's best to exclude it with the --notdirs, -D flag to avoid these kind of issues.
For example, jung -D node_modules -- cat package.json
ok, that works fine. i'll leave it to you if you want to close this issue, but it's resolved for me.