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
  • 1,140
  • 1
  • 9
  • 17
Vijay V.
  • 568
  • 2
  • 8
  • 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
  • 1,140
  • 1
  • 9
  • 17
2

try below command in your angular root folder

ng server --watch 
Pramod kushwaha
  • 449
  • 6
  • 17
-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
  • 10,492
  • 21
  • 82
  • 132
-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