You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When running fs.watch on a Vagrant vm and changing a file through the host machine, the change is not detected #6765
I'm running Ubuntu on a Vagrant virtual machine and I have set up a shared folder so changes to the folder and all subfolders are in sync. However, if I run fs.watch('/folder') in the VM and change a file in that folder through the host (Windows), the change is not detected.
That's a shortcoming of the way Vagrant exposes the host file system to the guest. The documentation touches on it in an indirect way:
If the underlying functionality is not available for some reason, then
`fs.watch` will not be able to function. For example, watching files or
directories on network file systems (NFS, SMB, etc.) often doesn't work
reliably or at all.
(NFS and SMB are commonly used protocols for mapping the host file system.)
You can use fs.watchFile() instead. I've added the doc label; we can probably add one or two lines on virtualization software. /cc @nodejs/documentation
Activity
bnoordhuis commentedon May 15, 2016
That's a shortcoming of the way Vagrant exposes the host file system to the guest. The documentation touches on it in an indirect way:
(NFS and SMB are commonly used protocols for mapping the host file system.)
You can use
fs.watchFile()instead. I've added thedoclabel; we can probably add one or two lines on virtualization software. /cc @nodejs/documentationeljefedelrodeodeljefe commentedon May 17, 2016
On it in #6809
doc: add note for fs.watch virtualized env
doc: add note for fs.watch virtualized env
doc: add note for fs.watch virtualized env
doc: add note for fs.watch virtualized env