Gulp Error watch path ENOSPC in gaze.js or grunt.js

When running Gulp with code like this:

gulp.task('default', ['watch']);

gulp.task('watch', ['css', 'js'], function () {
gulp.watch(scssSrc, ['css']);
gulp.watch(jsSrc, ['js']);
gulp.watch(svgSpriteSrc + "**/*.svg", ['svg']);
});

gulp.task('css', function () { /*и т.д. */}
gulp.task('js', function () { /*и т.д. */}
gulp.task('svg', function () { /*и т.д. */}

An error may occur that prevents the process from starting:

gulp_error

When running in the background, the dynamic collection of saved data in Ubuntu 18.04 is set to max_user_watches .

The fact is that the fs.inotify.max_user_watches parameter in /etc/sysctl.conf is responsible for simultaneously reading a certain number of files. When it reaches its limit, gulp's work is terminated.

Found the cure here and here :

echo fs.inotify.max_user_watches=131072 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

As a result, by increasing the number of simultaneously viewed files, we achieve the work of Gulp.

Don't go overboard with max_user_watches.

1246 0

Comments

Be the first to review this item. Share your rating and review so that other customers can decide if this is the right item for them.
You have to log in to leave a comment. Sign in

Similar articles

Code highlighting on the site using Js and Css

When describing minimal codes that have a syntax similar to C++, it may be necessary to have minimal highlighting on the site for better readability. I will give the easiest way to highlight, which I took from habrahabr. Consider, connect, describe ...