我将角度1应用升级到角度4,我已经安装了所有必需的节点模块。 在VS代码中,我没有得到任何编译器错误但是在运行gulp build getting error
时错误TS2307:找不到模块' @ angular / core。 我的app.module.ts:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { UpgradeModule } from '@angular/upgrade/static';
@NgModule({
imports: [
BrowserModule,
UpgradeModule
]
})
export class AppModule {
constructor(private upgrade: UpgradeModule) { }
ngDoBootstrap() {
this.upgrade.bootstrap(document.body, ['heroApp'], { strictDi: true });
}
}
tsconfig.json:
{
"compilerOptions": {
"moduleResolution": "node",
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
}
}
错误:
error TS2307: Cannot find module '@angular/core'.
谢谢,任何帮助将不胜感激。