Reputation: 566
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?
Upvotes: 1
Views: 4383
Reputation: 373
It's always a good idea to check that you are running the command on the right directory. Even if you are running ng serve
on an in-project IDE Command line, it could've changed and you might not have realized it.
directory\your-project-folder> ng serve
and not
directory\other-folder-project> ng serve
Upvotes: 0
Reputation: 449
try below command in your angular root folder
ng server --watch
Upvotes: 2
Reputation: 19
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
Upvotes: -1
Reputation: 1212
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
Upvotes: 3
Reputation: 10934
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:
npm cache clean
.npm install
.Since you are using a relatively older version of CLI, it would be better to update that as well!
Upvotes: -1