Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/460.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 检测vagrant来宾计算机中的文件更改_Javascript_Vagrant_Nfs_Gulp Watch_Grunt Contrib Watch - Fatal编程技术网

Javascript 检测vagrant来宾计算机中的文件更改

Javascript 检测vagrant来宾计算机中的文件更改,javascript,vagrant,nfs,gulp-watch,grunt-contrib-watch,Javascript,Vagrant,Nfs,Gulp Watch,Grunt Contrib Watch,我使用的是Vagrant 1.8.4,运行的是Ubuntu14.04Box。我已经安装了NodeV6.2.2,在主机上运行windows 10 x64位,当我更改js文件并运行gulp watch/babel script.js--watch--out file compiled.js时 问题在于来宾计算机未检测到更改 我尝试了以下方法,但没有成功: config.vm.synced_folder ".", "/var/www", :nfs => true,

我使用的是Vagrant 1.8.4,运行的是Ubuntu14.04Box。我已经安装了NodeV6.2.2,在主机上运行windows 10 x64位,当我更改js文件并运行gulp watch/babel script.js--watch--out file compiled.js时 问题在于来宾计算机未检测到更改

我尝试了以下方法,但没有成功:

 config.vm.synced_folder ".", "/var/www",          
     :nfs => true,                                 
     :mount_options => ["dmode=777", "fmode=666", "lookupcache=none"]  

and this
     :mount_options => ["dmode=777", "fmode=666", "actimeo=1"] 

请注意,

所以我在Vagrant和一个
Angular 4
+
Angular CLI
项目中遇到了同样的问题。运行开发服务器时,文件更改不会触发文件重建和应用程序重新加载。问题是,文件系统事件不会转发到流浪的虚拟机。安装
vagrant通知转发器
vagrant插件为我解决了这个问题:


    • 上述解决方案“流浪者通知货运代理”对我来说不可靠。有时它对mac不起作用

      “流浪者fsnotify”插件适合我

      请阅读此处了解配置设置