2016-04-29 60 views
-3

我試過了從https://angular.io/guide/quickstart的angular2 5 Min快速啓動。所有文件都是通過複製&粘貼創建的,因爲我很懶惰,並且可能有故障。我更喜歡TypeScript版本。最後,我必須編譯並以「npm start」開始。我以管理員身份執行此操作我的操作系統是Windows 10. 開始後,我收到一些錯誤。這是npm-debug.log:Angularjs 2快速啓動 - Npm運行錯誤

0 info it worked if it ends with ok 
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe', 
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 
1 verbose cli 'start' ] 
2 info using [email protected] 
3 info using [email protected] 
4 verbose node symlink C:\Program Files\nodejs\\node.exe 
5 verbose run-script [ 'prestart', 'start', 'poststart' ] 
6 info prestart [email protected] 
7 info start [email protected] 
8 verbose unsafe-perm in lifecycle true 
9 info [email protected] Failed to exec start script 
10 verbose stack Error: [email protected] start: `tsc && concurrently "npm run tsc:w" "npm run lite" ` 
10 verbose stack Exit status 2 
10 verbose stack  at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16) 
10 verbose stack  at EventEmitter.emit (events.js:110:17) 
10 verbose stack  at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14) 
10 verbose stack  at ChildProcess.emit (events.js:110:17) 
10 verbose stack  at maybeClose (child_process.js:1015:16) 
10 verbose stack  at Process.ChildProcess._handle.onexit (child_process.js:1087:5) 
11 verbose pkgid [email protected] 
12 verbose cwd C:\web\angular2-quickstart 
13 error Windows_NT 6.3.9600 
14 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 
15 error node v0.12.3 
16 error npm v2.9.1 
17 error code ELIFECYCLE 
18 error [email protected] start: `tsc && concurrently "npm run tsc:w" "npm run lite" ` 
18 error Exit status 2 
19 error Failed at the [email protected] start script 'tsc && concurrently "npm run tsc:w" "npm run lite" '. 
19 error This is most likely a problem with the angular2-quickstart package, 
19 error not with npm itself. 
19 error Tell the author that this fails on your system: 
19 error  tsc && concurrently "npm run tsc:w" "npm run lite" 
19 error You can get their info via: 
19 error  npm owner ls angular2-quickstart 
19 error There is likely additional logging output above. 
20 verbose exit [ 1, true ] 

任何人都可以幫我得到快速啓動應用程序啓動? 我也嘗試在Firefox中啓動index.html(因爲.ts文件全部翻譯爲.js文件),但沒有任何反應。

+0

試試這個http://stackoverflow.com/questions/34335340/angular2-quickstart-npm-start-is-not-working-correctly/36790628#36790628 – vineet

+1

@clsah是遵循這個問題鏈接,並確保您已正確安裝節點,併發,精簡服務器和打字稿。 –

回答

0

對不起,我的錯。文件app.component.ts是空的。我用正確的內容填充它並「運行npm start」,它可以工作。精簡版瀏覽器開始,我看到「我的第一個Angular 2應用程序」,我會很開心,直到我的日子結束。