Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad pattern #2

Closed
monolithed opened this issue Jun 11, 2014 · 2 comments
Closed

Bad pattern #2

monolithed opened this issue Jun 11, 2014 · 2 comments

Comments

@monolithed
Copy link

glob

var glob = require("glob");

glob('api/**/*.js', {}, function (error, files) {
    console.log(files);
});
[
    'api/one/pages/redirect.js',
    'api/two/pages/redirect.js'
]

saw

saw('api/**/*.js')
.on('ready', function (files) {
    console.log(files)
})
events.js:72
        throw er; // Unhandled 'error' event
              ^
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 Saw.createWatcher (/Users/me/workspace/apidoc/node_modules/saw/index.js:58:15)
    at Saw.onStat (/Users/me/workspace/apidoc/node_modules/saw/index.js:150:25)
    at Glob.EventEmitter.emit (events.js:98:17)
    at Glob._afterStat (/Users/me/workspace/apidoc/node_modules/saw/node_modules/glob/glob.js:621:12)
    at Object.oncomplete (fs.js:107:15)

cwd does not help as well

@carlos8f
Copy link
Owner

Hi,

the EMFILE error is probably your OS complaining about a watcher limit. Try this solution: nodejs/node-v0.x-archive#2479 (comment)

@monolithed
Copy link
Author

I did't have time to look for a solution and I've I have already started using the chokidar chokidar ✌️

But I'd like to anyway, so you have decided in this issue

PS:

➜ uname -a
Darwin monolihed.local 13.1.0 Darwin Kernel Version 13.1.0: 
Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64 (Mac OS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants