尝试在angular2中运行以下命令实现AOT
npm install @angular/compiler-cli typescript@next @angular/platform-server @angular/compiler
但是给我错误,你也可以一步一步地给我如何为AOT编译应用程序
另外我如何运行node_modules / .bin / ngc -p tsconfig-aot.json命令
UNMET PEER DEPENDENCY typescript@2.1.0-dev.20161012 invalid
npm WARN @angular/compiler-cli@0.6.4 requires a peer of typescript@^2.0.2 but none was installed.
npm WARN @angular/compiler-cli@0.6.4 requires a peer of @angular/core@2.0.2 but none was installed.
npm WARN @angular/platform-server@2.0.2 requires a peer of @angular/core@2.0.2 but none was installed.
npm WARN @angular/platform-server@2.0.2 requires a peer of @angular/common@2.0.2 but none was installed.
npm WARN @angular/platform-server@2.0.2 requires a peer of @angular/platform-browser@2.0.2 but none was installed.
npm WARN @angular/compiler@2.0.2 requires a peer of @angular/core@2.0.2 but none was installed.
npm WARN @angular/tsc-wrapped@0.3.0 requires a peer of typescript@^2.0.2 but none was installed.
1 回答
此错误是由未满足的依赖项引起的 . 您应该安装较新版本的angular2 . 之后,再次运行该命令 . 浏览项目的根路径并运行以下命令 .
您可以从here获取详细说明 .