运行angular / compiler-cli命令时出错

时间:2016-10-12 11:36:29

标签: angular

尝试在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 个答案:

答案 0 :(得分:1)

此错误是由未满足的依赖项引起的。您应该安装较新版本的angular2。 之后,再次运行该命令。 浏览项目的根路径并运行以下命令。

node_modules/.bin/ngc -p tsconfig-aot.json

您可以从here获得详细说明。