错误,当我部署ng build –prod Angular 4.3.2

我已经通过以下方式将angular度从4.0.0升级到4.3.2:

npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest rxjs@latest --save 

然后我把ng serve和运作良好,但是当我想通过ng build --prod我有以下错误:

 [1m[33mWARNING in ./src/$$_gendir/app/app.module.ngfactory.ts 730:2-27 "export 'ɵNgModuleInjector' (imported as 'import0') was not found in '@angular/core'[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/core/core.ngfactory.ts (11,49): Property 'ɵNgModuleInjector' does not exist on type 'typeof "C:/Data/angular4/system/node_modules/@angular/core/core"'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/core/core.ngfactory.ts (41,79): Property 'parent' does not exist on type 'ApplicationModuleInjector'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/core/core.ngfactory.ts (45,76): Property 'parent' does not exist on type 'ApplicationModuleInjector'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/core/core.ngfactory.ts (46,38): Property 'parent' does not exist on type 'ApplicationModuleInjector'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/core/core.ngfactory.ts (46,70): Property 'parent' does not exist on type 'ApplicationModuleInjector'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/core/core.ngfactory.ts (46,99): Argument of type 'this' is not assignable to parameter of type 'Injector'. Type 'ApplicationModuleInjector' is not assignable to type 'Injector'. Property 'get' is missing in type 'ApplicationModuleInjector'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/core/core.ngfactory.ts (46,109): Property 'parent' does not exist on type 'ApplicationModuleInjector'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/core/core.ngfactory.ts (46,147): Property 'componentFactoryResolver' does not exist on type 'ApplicationModuleInjector'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/core/core.ngfactory.ts (67,94): Cannot create an instance of the abstract class 'NgModuleFactory'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/common/common.ngfactory.ts (11,44): Property 'ɵNgModuleInjector' does not exist on type 'typeof "C:/Data/angular4/system/node_modules/@angular/core/core"'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/common/common.ngfactory.ts (18,111): Property 'parent' does not exist on type 'CommonModuleInjector'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/common/common.ngfactory.ts (33,84): Cannot create an instance of the abstract class 'NgModuleFactory'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/platform-browser/platform-browser.ngfactory.ts (12,45): Property 'ɵNgModuleInjector' does not exist on type 'typeof "C:/Data/angular4/system/node_modules/@angular/core/core"'.[39m[22m 

另外我正在显示文件内容:main.ts

 import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule); 

我正在互联网上检查这个,但我没有find解决的理由。 有什么可能丢失?

Solutions Collecting From Web of "错误,当我部署ng build –prod Angular 4.3.2"