ng服务不工作和ng服务 - 但工作但ng build --aot不工作

时间:2018-06-12 12:03:04

标签: angular

我正试图通过ng serve运行我的角度应用程序。它给了我错误,当我尝试使用ng serve --aot时,它工作正常,但当我使用ng build --aot构建时,它在我的浏览器控制台中发出以下错误。

  

未捕获(承诺):错误:加载块布局 - layout-layout-module-ngfactory失败。\ n(错误:http://127.0.0.1:8000/layouts-layout-layout-module-ngfactory.js)\ nonScriptComplete @ http://127.0.0.1:8000/static/runtime.js:136:29 \ nwrapFn @ {{3} } \ n./node_modules/zone.js/dist/zone.js/http://127.0.0.1:8000 /静态/ polyfills.js:2743:17 \ nonInvokeTask @ http://127.0.0.1:8000/static/polyfills.js:3510:30 \ n./node_modules/ zone.js /距离/ zone.js / HTTP://127.0.0.1:8000 /静态/ polyfills.js:2742:17 \ n./node_modules/zone.js/dist/zone.js/http://127.0 .0.1:8000 /静态/ polyfills.js:2510:28 \ n./node_modules/zone.js/dist/zone.js/http://127.0.0.1:8000 /静态/ polyfills.js:2818:24 \ ninvokeTask @ http://127.0.0.1:8000/static/vendor.js:32961:24 \ nglobalZoneAwareCallback @ http://127.0.0.1:8000/static/polyfills.js:3862:9 \ n

我的配置

OS- Ubuntu 16.4

Angular CLI: 6.0.7
Node: 8.11.1
OS: linux x64
Angular: 6.0.3
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.7
@angular-devkit/build-angular     0.6.7
@angular-devkit/build-optimizer   0.6.7
@angular-devkit/core              0.6.7
@angular-devkit/schematics        0.6.7
@angular/animations               6.0.4
@angular/cdk                      6.2.1
@angular/cli                      6.0.7
@angular/material                 6.2.1
@ngtools/webpack                  6.0.7
@schematics/angular               0.6.7
@schematics/update                0.6.7
rxjs                              6.2.0
typescript                        2.7.2
webpack                           4.8.3

请帮我构建一下。

0 个答案:

没有答案