-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fs.watch not work in win10 Bash. #7496
Comments
I suspect the Linux subsystem doesn't implement inotify yet or puts some restraints on it. Almost certainly not a bug in node.js. |
I just wrote a cpp program to test inotify api , the inotify_add_watch return -1 , not work. thank you! |
Thanks, I'll close out the issue. |
I did some tweets and hopefully they made it it to Microsoft to do list, hopefully the high priority list hehe |
I found best way to notify microsoft the importance of fixing this issue. Vote here: support-for-filesystem-watchers-like-inotify Currently it's # 5! also Windows Subsystem For Linux (WSL) User Voice main page |
This should now work in Windows 10 Insider builds >= 14942 |
@bitcrazed I have just singup for Insider Preview Builds in windows settings, and installed updates after it, but my build is 14393 (in System Information). Is it correct? Am I able to get higher builds? |
@whitecolor, Windows Creator Update was released you should be able to get |
I can confirm it works with node var fs = require('fs');
fs.watch('/mnt/d/code/4node', function(event) {
console.info('/mnt/d/code/4node')
console.info(event)
})
fs.watch('/home/refael', function(event) {
console.info('/home/refael')
console.info(event)
}) refael@refaelux:/mnt/d/code/4node$ node test-7496.js
refael@refaelux:~$ touch test.test
/home/refael
rename
/home/refael
change
refael@refaelux:/mnt/c/code/4node$ touch test.test
/mnt/d/code/4node
rename
/mnt/d/code/4node
change
/mnt/d/code/4node
change
refael@refaelux:/mnt/d/code/4node$ rm test.test
/mnt/d/code/4node
rename
/mnt/d/code/4node
rename
/mnt/d/code/4node
rename |
@refack uh yes thanks for the tip) |
win10 provides developers with a familiar Bash environment.
I'm try to use node in win10 Bash,fs.watch not work ,throw EPERM exception.
fs.watchFile is ok.
node version : v6.2.1. (Linux Binaries)
window version : windows 10 insider preview 14366
linux subsystem version : Linux DESKTOP-RNI52ML 3.4.0+ #1 PREEMPT Thu Aug 1 17:06:05 CST 2013 x86_64 x86_64 x86_64 GNU/Linux
test file
test.js
var path = require('path');
fs.watch('/home/li/app1/', function(event) {
console.info(event)
})
exception :
fs.js:1425
throw error;
^
Error: watch /home/li/app1/ EPERM
at exports._errnoException (util.js:1007:11)
at FSWatcher.start (fs.js:1423:19)
at Object.fs.watch (fs.js:1450:11)
at Object. (/mnt/c/Users/li/git/portal/integration_fe/test.js:4:4)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Function.Module.runMain (module.js:575:10)
The text was updated successfully, but these errors were encountered: