gulp watch error (ENOSPC) #217

Closed
escapedcat opened this Issue Jan 29, 2014 · 15 comments

Comments

Projects
None yet

Since today my watch task is broken.
That's what I get:

gulp watch
[gulp] Using file /var/www/project/gulpfile.js
[gulp] Working directory changed to /var/www/project
[gulp] Running 'watch'...
[gulp] Errored 'watch' in 10 ms watch ENOSPC

/var/www/project/node_modules/gulp/node_modules/orchestrator/index.js:153
            throw err;
                  ^
Error: watch ENOSPC
    at errnoException (fs.js:1019:11)
    at FSWatcher.start (fs.js:1051:11)
    at Object.fs.watch (fs.js:1076:11)
    at Gaze._watchDir (/var/www/project/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:279:30)
    at /var/www/project/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:336:10
    at iterate (/var/www/project/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/helper.js:52:5)
    at Object.forEachSeries (/var/www/project/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/helper.js:66:3)
    at Gaze._initWatched (/var/www/project/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:332:10)
    at Gaze.add (/var/www/project/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:167:8)
    at new Gaze (/var/www/project/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:68:10)

My gulpfile.js:

var gulp        = require('gulp');

// Watch
gulp.task('watch', function() {
    // Watch .scss files
    gulp.watch('app/sass/**/*.scss', function(event) {
        //console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
    });
});

My package.js:

{
  "name": "project",
  "version": "0.0.1",
  "dependencies": {
  },
  "devDependencies": {
    "gulp": "*",
    "gulp-ruby-sass": "*",
    "gulp-minify-css": "*",
    "gulp-jshint": "*",
    "gulp-concat": "*",
    "gulp-uglify": "*",
    "gulp-imagemin": "*",
    "gulp-clean": "*",
    "gulp-cache": "*",
    "gulp-notify": "*",
    "gulp-web-modules": "*",
    "gulp-serve": "*",
    "gulp-plumber": "*",
    "jshint-stylish": "*"
  }
}

Not sure if I somehow broke something... but it was working before :P

Owner

phated commented Jan 29, 2014

It looks like is related to the number of files you are watching. See http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc

Owner

contra commented Jan 29, 2014

gaze problem open there

@contra contra closed this Jan 29, 2014

And working again, without changing something... I was only watching 5 (rather small) files.
Maybe I was just low on memory in general at the point. Weird.
But thx for pointing out the stackoverflow link. I didn't see that one.

in linux you fix this with the command:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

That actually works 😄

@cancerberoSgx cheers.

context:

  • only watching one coffeescript file.

mzahor commented Mar 7, 2015

@cancerberoSgx thanks, it works.

@sergeylaptev sergeylaptev referenced this issue in sergeylaptev/react-fundamentals Mar 12, 2015

Closed

Проблема с task 'watch' #1

@ghost

ghost commented Mar 12, 2015

Thanks @cancerberoSgx . it's work.

@cancerberoSgx Thanks man! it works!

racerboy commented Jul 1, 2015

@cancerberoSgx Great! How did you know that? Thanks!

rlucha commented Jul 5, 2015

@cancerberoSgx thank you :)

@cancerberoSgx Thanks man! it works!

Member

callumacrae commented Jul 13, 2015

@contra / @phated / @sindresorhus please could you lock this? Too much noise :(

@sindresorhus sindresorhus locked and limited conversation to collaborators Jul 13, 2015

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