2016-11-22 121 views
0

我已經從以下github下載了Tour Of Heroes應用程序。ngc編譯錯誤爲typings/index.d.ts'未找到

我已經成功地與npm start

運行應用程序但是,當我嘗試運行npm run start-aot

然後我收到以下錯誤。

[email protected] start-aot D:\angular2-to 
ur-of-heroes-master 

npm run aot && npm run rollup && gulp copy-aot && npm run lite 


[email protected] aot D:\angular2-tour-of- 
heroes-master 
ngc -p tsconfig-aot.json 

Error: Error File 'D:/angular2-tour-of-heroes-master/typ 
ings/index.d.ts' not found. 
    at Object.check (D:\angular2-tour-of-heroes-master\n 
ode_modules\@angular\tsc-wrapped\src\tsc.js:31:15) 
    at Object.main (D:\angular2-tour-of-heroes-master\no 
de_modules\@angular\tsc-wrapped\src\main.js:26:15) 
    at Object.<anonymous> (D:\angular2-tour-of-heroes-ma 
ster\node_modules\@angular\compiler-cli\src\main.js:16:9) 
    at Module._compile (module.js:570:32) 
    at Object.Module._extensions..js (module.js:579:10) 
    at Module.load (module.js:487:32) 
    at tryModuleLoad (module.js:446:12) 
    at Function.Module._load (module.js:438:3) 
    at Module.runMain (module.js:604:10) 
    at run (bootstrap_node.js:394:7) 
Compilation failed 

在的package.json以下是依賴

"dependencies": { 
    "@angular/common": "~2.1.0", 
    "@angular/compiler": "~2.1.0", 
    "@angular/compiler-cli": "^2.1.2", 
    "@angular/core": "~2.1.0", 
    "@angular/forms": "~2.1.0", 
    "@angular/http": "~2.1.0", 
    "@angular/platform-browser": "~2.1.0", 
    "@angular/platform-browser-dynamic": "~2.1.0", 
    "@angular/platform-server": "^2.2.1", 
    "@angular/router": "~3.1.0", 
    "@angular/upgrade": "~2.1.0", 
    "angular-in-memory-web-api": "~0.1.5", 
    "core-js": "^2.4.1", 
    "reflect-metadata": "^0.1.8", 
    "rxjs": "5.0.0-beta.12", 
    "systemjs": "0.19.39", 
    "zone.js": "^0.6.25" 
    } 
+0

您正在使用哪個版本的a2? – micronyks

回答

1

的AOT問題已經現在固定。有關更多信息,請參閱here。最簡單的做法是再次克隆回購。

+0

我正在尋找一個良好的angular2種子項目。你能幫忙嗎? –

+0

@ParthaSarathiGhosh Angular 2將會使用[Angular-cli](https://github.com/angular/angular-cli)爲我的項目使用任何SystemJs或WebPack種子項目。還有一個很好的入門教程[這裏](https://www.youtube.com/watch?v=uBRK6cTr4Vk)。 – JayChase

相關問題