This recently started happening in my gulp.watch task. It was working fine as of two weeks ago.
When I run $ gulp
when it gets to the watch task, it throws the following:
(FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
events.js:85
throw er; // Unhandled 'error' event
^
Error: watch EMFILE
at exports._errnoException (util.js:746:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1157:26)
Per a few suggestions, I have updated node.js, with no luck.
There was also the suggestion that I was trying to watch too many files, so I changed the watch dir to a single file. Still throws the error.
Ive updated gulp to 3.9 globally and locally, along with my dependencies. I even rolled gulp back to an older version on both to see if that worked. No luck.
What could be throwing this on a gulp.watch task?
Here is my gulpfile task:
// Watch
gulp.task('watch', function() {
// Listen on port 35729
server.listen(35729, function (err) {
if (err) {
return console.log(err)
};
// Watch .scss files
gulp.watch('assets/styles/*.scss', ['styles']);
});
});
From the code you've posted, you've invoked gulp.watch
but with no instruction as to what should happen when a file changes?
Normally a watch task would trigger the running of another task upon a file change. One would assume that watching changes in scss
files should trigger scss
compilation.
gulp.watch('assets/styles/style.scss', ['scss:compile']);
// where 'scss:compile' is another defined task for scss compilation.
Hope that helps you out and might give you some different output :)