angular 2 CLI live reload is not working [duplicat

2019-05-21 05:31发布

问题:

This question already has an answer here:

  • Not able to change anything in Angular2 application when i create it using Angular CLI 3 answers

I am creating angular 2 application through "angular-cli" version "1.0.0-beta.28.3".

When I am using commands "npm start" or "ng serve", the app is working at http://localhost:4200

But, when changing some code for type Script file or CSS, the live refresh for browser is not happening. What's wrong here? Thanks!

回答1:

Try deleting your node_modules folder and running npm install again. This should upgrade a bad npm dependency.

By the way, you might also want to upgrade to Angular CLI beta 29 as beta 28.3 has a few issues in general. If you do so, note that the package name has changed in beta.29 from angular-cli to @angular/cli.