我正在使用angular-cli。我有以下錯誤。./src/main.ts中的錯誤找不到模塊(ng build --prod)
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'D:\material\matapp\src' @ ./src/main.ts 3:0-74 @ multi ./src/main.ts
我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);
我的main.ts文件是來自'@ angular/core'的import {enableProdMode}; 從'@ angular/platform-browser-dynamic'導入{platformBrowserDynamic}; 從'./app/app.module'導入{AppModule}; 從'./environments/environment'導入{environment}; if(environment.production){enableProdMode(); } platformBrowserDynamic()。bootstrapModule(AppModule); –
您正在使用哪個'angular-cli'版本? –
@ angular/cli:1.2.0 –