angular 2 CLI 实时重新加载不起作用

问题描述:

我正在通过angular-cli"版本1.0.0-beta.28.3"创建 angular 2 应用程序.

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

当我使用命令npm start"或ng serve"时,应用程序在http://localhost:4200

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

但是,当更改脚本文件或 CSS 类型的某些代码时,浏览器的实时刷新不会发生.这里有什么问题?谢谢!

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

尝试删除您的 node_modules 文件夹并再次运行 npm install.这应该升级一个糟糕的 npm 依赖项.

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

顺便说一下,您可能还想升级到 Angular CLI beta 29,因为 beta 28.3 总体上存在一些问题.如果这样做,请注意 beta.29 中的包名称已从 angular-cli 更改为 @angular/cli.

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.