2

I'm trying to use browser-sync to work on my Flask project. My gulpfile.js looks like this:

var gulp = require('gulp');
var bs = require('browser-sync').create();
var exec = require('child_process').exec;
var browserSync = require('browser-sync');


gulp.task('preload', function() {});

gulp.task('run-server', function() {
    var proc = exec('python3 run.py');
});

gulp.task('default', ['preload', 'run-server'], function() {
    browserSync({
        notify: false,
        proxy: '0.0.0.0:5000',
        files: [
            "web/templates/*.html"
        ],
        port: 7000
    });
});

I'm specifying the path to the html files I want to watch in the files array. When I run this, I get this error:

[15:26:18] Using gulpfile ~/Learning/vision-boilerplate/gulpfile.js
[15:26:18] Starting 'preload'...
[15:26:18] Finished 'preload' after 30 μs
[15:26:18] Starting 'run-server'...
[15:26:18] Finished 'run-server' after 3.6 ms
[15:26:18] Starting 'default'...
[15:26:18] Finished 'default' after 14 ms

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: watch ENOSPC
    at errnoException (fs.js:1024:11)
    at FSWatcher.start (fs.js:1056:11)
    at Object.fs.watch (fs.js:1081:11)
    at createFsWatchInstance (/home/user/Learning/vision-boilerplate/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/home/user/Learning/vision-boilerplate/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/user/Learning/vision-boilerplate/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/user/Learning/vision-boilerplate/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:407:19)
    at FSWatcher.<anonymous> (/home/user/Learning/vision-boilerplate/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:455:19)
    at FSWatcher.<anonymous> (/home/user/Learning/vision-boilerplate/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:460:16)
    at Object.oncomplete (fs.js:107:15)

If I omit the files array from the browserSync parameters, everything works fine (except of course it doesn't reload on changes to html files).

Juicy
  • 11,840
  • 35
  • 123
  • 212
  • Possible duplicate of [Grunt watch error - Waiting...Fatal error: watch ENOSPC](http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc) – Sven Schoenung Aug 30 '16 at 15:25

0 Answers0