Stafford Williams
Stafford Williams

Reputation: 9806

Why does gulp.watch or fs.watch not work on Bash on Ubuntu on Windows?

On Bash on Ubuntu on Windows, a gulp task like this;

gulp.task('default', function() {
    gulp.watch('./', function() {console.log('change!')});
});

or just calling fs.watch directly from node;

node -e "require('fs').watch('./')"

both fail with the following;

Error: watch ./ EPERM
    at exports._errnoException (util.js:1012:11)
    at FSWatcher.start (fs.js:1429:19)
    at Object.fs.watch (fs.js:1456:11)
    at [eval]:1:15
    at ContextifyScript.Script.runInThisContext (vm.js:25:33)
    at Object.exports.runInThisContext (vm.js:77:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:541:32)
    at bootstrap_node.js:315:29
    at _combinedTickCallback (internal/process/next_tick.js:67:7)

How can I use gulp.watch under Bash on Ubuntu on Windows?

Upvotes: 2

Views: 1909

Answers (1)

Stafford Williams
Stafford Williams

Reputation: 9806

Currently Bash on Ubuntu on Windows has no support for filesystem watchers like inotify. You can vote for such a feature on the project's uservoice.

Further discussion in this github issue

EDIT: Looks like this has now been fixed in development and is set to be released to the general public sometime early 2017.

Upvotes: 3

Related Questions