1

When i changed the code in Angular4 then page is not refreshing. i have to again start the server using

ng serve --open

Every time i change I have to restart the server.

Please guide me!

Is there any other option to avoid this?

Vignesh
  • 979
  • 1
  • 7
  • 15
Vijay V.
  • 568
  • 2
  • 6
  • 24

4 Answers4

3

try

ng serve --open --watch

if this does not work try cache clean and npm install

If you are using Ubuntu Try reseting the number of watches this might solve the problem

echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches

Vignesh
  • 979
  • 1
  • 7
  • 15
2

try below command in your angular root folder

ng server --watch 
Pramod kushwaha
  • 449
  • 6
  • 16
-1

As mentioned in a similar answer here, try deleting your node_modules folder and running npm install again. This should upgrade a bad npm dependency.

I would recommend deleting cache as well, follow below steps:

  1. Delete node_modules folder.
  2. npm cache clean.
  3. npm install.

Since you are using a relatively older version of CLI, it would be better to update that as well!

Community
  • 1
  • 1
Peter
  • 9,437
  • 14
  • 79
  • 120
-1

In Ubuntu run this command when your Angular page does not detect changes.

 echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
  • This is no different than what is suggested in the 2nd part of Vignesh's existing answer... – Ross Jun 08 '18 at 20:29