I have created a sample project wiht Ng-cli, then i run ng serve in the source folder, the project loads correctly in the browser but livereload not working.
npm -v : 3.10.9
ng -v: angular-cli: 1.0.0-beta.19-3 node: 4.4.3 os: win32 x64
Already searched a lot information on internet, and nothing solved the issue.
I faced with the same problem on Ubuntu 16.04 and angular CLI 1.0.0.
The problem was related with Inotify Watches Limit on Linux. To solve the issue, I increased the watches limit to 512K. Run these commands.
sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl -p --system
After that, I restarted my IDE, and after that, the change detection started to work.
Increasing the amount of inotify watchers
The technical details
Listen uses inotify by default on Linux to monitor directories for changes. It's not uncommon to encounter a system limit on the number of files you can monitor. For example, Ubuntu Lucid's (64bit) inotify limit is set to 8192.
You can get your current inotify file watch limit by executing:
$ cat /proc/sys/fs/inotify/max_user_watches
When this limit is not enough to monitor all files inside a directory, the limit must be increased for Listen to work properly.
You can set a new limit temporary with:
$ sudo sysctl fs.inotify.max_user_watches=524288 $ sudo sysctl -p
If you like to make your limit permanent, use:
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf $ sudo sysctl -p
You may also need to pay attention to the values of
max_queued_events
andmax_user_instances
if Listen keeps on complaining.
Source
Try ng serve -lr
flag. This flag works with me.
Probably the issue occurs becuase --live-reload flag is deprecated
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With