Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.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
Ember.js Vagrant、Ember cli、Windows 8.1、Ubuntu。利弗雷洛德没有';不行!它没有';从Windows保存时检测不到更改_Ember.js_Vagrant_Ember Cli_Livereload_Watchman - Fatal编程技术网

Ember.js Vagrant、Ember cli、Windows 8.1、Ubuntu。利弗雷洛德没有';不行!它没有';从Windows保存时检测不到更改

Ember.js Vagrant、Ember cli、Windows 8.1、Ubuntu。利弗雷洛德没有';不行!它没有';从Windows保存时检测不到更改,ember.js,vagrant,ember-cli,livereload,watchman,Ember.js,Vagrant,Ember Cli,Livereload,Watchman,我有一个流浪汉档案: Vagrant.configure("2") do |config| # Use Ubuntu 14.04 Trusty Tahr 64-bit as our operating system config.vm.box = "ubuntu/trusty64" # Configurate the virtual machine to use 2GB of RAM config.vm.provider :virtualbox do |vb| vb.c

我有一个流浪汉档案:

Vagrant.configure("2") do |config|
  # Use Ubuntu 14.04 Trusty Tahr 64-bit as our operating system
  config.vm.box = "ubuntu/trusty64"

  # Configurate the virtual machine to use 2GB of RAM
  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--memory", "2048"]
  end

  # Forward the Rails server default port to the host
  config.vm.network :forwarded_port, guest: 4200, host: 4200
  config.vm.network :forwarded_port, guest: 35729, host: 35729
一切正常,在我的Windows中我可以访问
http://localhost:4200
,它可以工作。但是,有一个很大的问题

我将余烬的项目文件保存在与vagrant共享的Windows文件夹中。

如果我在Windows中保存我的ember项目的文件,我就不能使用livereload,在我的
vagrant ssh中,我甚至不能查看检测到的更改

如果我使用
vagrant ssh
并使用
nano application.hbs
,然后保存新的内容,它会检测到更改,livereload会在Windows上我的Chrome窗口中工作


到底是什么问题?

我相信这可能会帮助您:

看来你并没有回到投票观察者那里


您也没有使用NFS,因为它不在您的配置中。对于windows用户,您应该使用and install with
vagrant插件安装vagrant winnfsd

我用以下方法解决了这个问题:
ember-service--watcher polling
。与Vagrant共享NFS在Windows上不起作用。

Vagrant在桌面和VM之间同步目录的方式将破坏ember cli用于监视文件的默认机制,并在随后编译更新时导致问题

要恢复此功能,可以将以下行添加到“.ember cli”文件中

"liveReload": true,
"watcher": "polling"
或者使用回退轮询观察程序调用serve命令

ember serve --watcher polling

你的余烬项目与vagrant共享?@FredericHenri,是的,我在Windows文件夹中有余烬项目文件与vagrant共享。你应该显示配置文件,你在使用rsync吗?它不清楚当你说你在windows上做了更改,你看不到他们从虚拟机。尝试在windows上创建新文件,它在VM上可用吗?同样的,当你从虚拟机上工作时,你在虚拟机上看到变化了吗windows@FredericHenri,我没有使用rsync,我使用的是Vagrant的简单配置。如果我在
vagrant ssh
中使用vi或nano或其他编辑器修改文件,它会正常工作。Livereload(带eatchman)检测更改。如果我在同一个目录中使用记事本或SublimiteText或Windows中的其他编辑器(在与vagrant共享的同一目录中)修改文件,则不会检测到任何内容,因此livereload无法工作。如果我的回答对您有帮助,请您将其标记为正确?我删除了关于NFS的部分。这可能不是很有效,但是是克服virtualbox共享问题的一个很好的解决方法。