2016-11-23 68 views
1

我試圖做一個非常基本的應用AOT編譯,和我得到的窗口這個錯誤,我失去了任何包,因爲我沒用過角CLI來啓動Angular2 AOT編譯錯誤:createAotCompiler不是一個函數

> 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

到沒有你的幫助,但是這並不侷限於窗口,我得到與Linux一樣,我也用角CLI開始 – paul

回答

1

我想你,因爲角模塊相互之間的依賴關係版本不匹配的遇到此。

你的依賴的頂部應該是這樣的,以配合編譯器,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", 
+0

這個固定爲我 – paul

相關問題