shama / gaze

:crystal_ball: A globbing fs.watch wrapper built from the best parts of other fine watch libs.
MIT License
1.15k stars 168 forks source link

Getting Gaze._watchDir error in gulp watch #202

Closed ashish91 closed 9 years ago

ashish91 commented 9 years ago
[14:25:05] Error: watch ENOSPC
    at errnoException (fs.js:1031:11)
    at FSWatcher.start (fs.js:1063:11)
    at Object.fs.watch (fs.js:1088:11)
    at Gaze._watchDir (/home/ashish/codebase/coef/coef-web-app/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:289:30)
    at /home/ashish/codebase/coef/coef-web-app/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:358:10
    at iterate (/home/ashish/codebase/coef/coef-web-app/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/helper.js:52:5)
    at Object.forEachSeries (/home/ashish/codebase/coef/coef-web-app/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/helper.js:66:3)
    at Gaze._initWatched (/home/ashish/codebase/coef/coef-web-app/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:354:10)
    at Gaze.add (/home/ashish/codebase/coef/coef-web-app/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:177:8)
    at new Gaze (/home/ashish/codebase/coef/coef-web-app/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:74:10)
Error running task sequence: { [Error: watch ENOSPC] code: 'ENOSPC', errno: 'ENOSPC', syscall: 'watch' }

Following is my gulp task:

var gulp        = require('gulp');
var config      = require('../config');
var runSequence = require('run-sequence');

gulp.task('watch', function(){
    runSequence( 'js', 'sass', 'browserSync');
    gulp.watch([config.sass.src, 'node_modules/bootstrap-sass/assets/stylesheets/**/*'], ['sass']);
    gulp.watch([config.js.src], ['js']);
    gulp.watch([config.html.src], ['html']);
    gulp.watch([config.locales.src], ['locales'])
});

My colleague is not getting this error who's on 0.5.1 version. I checked that glob-watcher package was using 0.5.2 version in my case.

glob-watcher@0.0.6
└─┬ gaze@0.5.2
  └─┬ globule@0.1.0
    ├─┬ glob@3.1.21
    │ ├── graceful-fs@1.2.3
    │ └── inherits@1.0.2
    ├── lodash@1.0.2
    └─┬ minimatch@0.2.14
      ├── lru-cache@2.7.0
      └── sigmund@1.0.1

I searched through SO and all says to upgrade to 0.5.x version but I am seeing the issue still in 0.5.1

shama commented 9 years ago

It sounds like you'll need to increase your max_user_watches: http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc

Or check to make sure you don't have a pattern running loose and watching a ton of unintended files.

ashish91 commented 9 years ago

Thanks @shama, solved the problem. kudos :+1:

alimakarfi commented 7 years ago

Thanks @shama, solved the problem