我正在尝试在一个非常基本的应用程序上进行AoT编译,我在Windows中收到此错误,我错过了任何包,因为我没有使用angular-cli启动
> TypeError: compiler.createAotCompiler is not a function
> at Function.CodeGenerator.create (...\node_modules\@angular\compiler-cli\src\codegen.js:78:36)
节点版本:5.2.0
套餐
"dependencies": {
"@angular/common": "^2.2.1",
"@angular/compiler": "^2.2.1",
"@angular/compiler-cli": "^2.2.2",
"@angular/core": "^2.2.1",
"@angular/forms": "^2.2.1",
"@angular/http": "^2.2.1",
"@angular/platform-browser": "^2.2.1",
"@angular/platform-browser-dynamic": "^2.2.1",
"@angular/platform-server": "^2.2.2",
"@angular/router": "^3.2.1",
"@angular/upgrade": "^2.2.1",
"angular-in-memory-web-api": "^0.1.15",
"core-js": "^2.4.1",
"reflect-metadata": "^0.1.8",
"rxjs": "^5.0.0-rc.4",
"systemjs": "^0.19.41",
"zone.js": "^0.6.26"
},
"devDependencies": {
"@types/core-js": "^0.9.34",
"@types/node": "^6.0.48",
"systemjs-builder": "^0.15.34",
"typescript": "^2.0.10"
}
答案 0 :(得分:2)
我认为您遇到此问题是因为角度模块之间存在版本不匹配。
依赖项的顶部应该像这样与compiler-cli的2.2.2版匹配。
"@angular/common": "^2.2.2",
"@angular/compiler": "^2.2.2",
"@angular/compiler-cli": "^2.2.2",
"@angular/core": "^2.2.2",
"@angular/forms": "^2.2.2",
"@angular/http": "^2.2.2",
"@angular/platform-browser": "^2.2.2",
"@angular/platform-browser-dynamic": "^2.2.2",
"@angular/platform-server": "^2.2.2",
"@angular/router": "^3.2.2",
"@angular/upgrade": "^2.2.2",