组件文件中的代码更改后,Angular cli live reload不起作用

时间:2018-03-24 10:11:03

标签: angular

在任何组件文件中更改代码后,Angular cli live reload无法正常工作,但它接受html更改。

Angular ng --version如下

angular-cli: 1.0.0-beta.28.3
node: 6.9.1
os: win32 x64
@angular/animations: 4.4.3
@angular/common: 4.4.3
@angular/compiler: 4.4.3
@angular/core: 4.4.3
@angular/forms: 4.4.3
@angular/http: 4.4.3
@angular/platform-browser: 4.4.3
@angular/platform-browser-dynamic: 4.4.3
@angular/router: 4.4.3
@angular/cli: 1.3.2
@angular/compiler-cli: 4.4.3

获取如下错误:

ERROR in ./src/app/modules/TechRefresh/maintenance/components/location-admin/station/station.component.ts
Module build failed: Error
    at WebpackCompilerHost.populateWebpackResolver (C:\gems\workspace\gems2\gems
-ui-framework\node_modules\@ngtools\webpack\src\compiler_host.js:162:68)
    at _donePromise.Promise.resolve.then.then.then.then.then (C:\gems\workspace\
gems2\gems-ui-framework\node_modules\@ngtools\webpack\src\plugin.js:416:32)
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/app/modules/TechRefresh/maintenance/components/location-admin/location-
admin.module.ts 12:0-63
 @ ./aot lazy
 @ ./node_modules/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

可以帮忙解决?谢谢。

1 个答案:

答案 0 :(得分:0)

将您的角度cli更新为1.7.x

installation已更改为:

npm install -g @angular/cli

您使用的是旧版角度cli。