2016-11-12 13 views
1

を実行した後、私は角度のクイックスタートの手順を実行するのですが、最終的に、「NPM開始」を実行した後に、エラー、次の私を与える:アプリのクラッシュは、NPM startコマンド

node_modules/@angular/common/src/directives/ng_class.d.ts(46,34): error TS2304: Cannot find name 'Set'. 
node_modules/@angular/common/src/pipes/async_pipe.d.ts(44,38): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/compiler/src/compile_metadata.d.ts(347,20): error TS2304: Cannot find name 'Set'. 
node_modules/@angular/compiler/src/compile_metadata.d.ts(348,15): error TS2304: Cannot find name 'Set'. 
node_modules/@angular/compiler/src/directive_normalizer.d.ts(19,100): error TS2304: Cannot find name 'Promise'. 

node_modules/@angular/compiler/src/directive_normalizer.d.ts(21,74): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/compiler/src/offline_compiler.d.ts(19,32): error TS2304: Cannot find name 'Map'. 
node_modules/@angular/compiler/src/offline_compiler.d.ts(43,9): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/compiler/src/output/output_ast.d.ts(424,63): error TS2304: Cannot find name 'Set'. 
node_modules/@angular/compiler/src/resource_loader.d.ts(13,23): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/compiler/src/runtime_compiler.d.ts(45,49): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/compiler/src/runtime_compiler.d.ts(47,65): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/compiler/src/util.d.ts(25,18): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/compiler/src/util.d.ts(26,46): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/core/src/application_init.d.ts(16,18): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/core/src/application_ref.d.ts(106,67): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/core/src/application_ref.d.ts(122,101): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/core/src/application_ref.d.ts(148,67): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/core/src/application_ref.d.ts(150,101): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,15): error TS2304: Cannot find name 'Map'. 
node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(28,16): error TS2304: Cannot find name 'Map'. 
node_modules/@angular/core/src/di/reflective_provider.d.ts(88,123): error TS2304: Cannot find name 'Map'. 
node_modules/@angular/core/src/di/reflective_provider.d.ts(88,165): error TS2304: Cannot find name 'Map'. 
node_modules/@angular/core/src/facade/collection.d.ts(4,9): error TS2304: Cannot find name 'Map'. 
node_modules/@angular/core/src/facade/collection.d.ts(5,23): error TS2304: Cannot find name 'Map'. 
node_modules/@angular/core/src/facade/collection.d.ts(6,25): error TS2304: Cannot find name 'Map'. 
node_modules/@angular/core/src/facade/lang.d.ts(12,17): error TS2304: Cannot find name 'Map'. 
node_modules/@angular/core/src/facade/lang.d.ts(13,17): error TS2304: Cannot find name 'Set'. 
node_modules/@angular/core/src/linker/compiler.d.ts(53,49): error TS2304: Cannot find name 'Promise'. 
node_modules/@angular/core/src/linker/compiler.d.ts(61,65): error TS2304: Cannot find name 'Promise'. 

NPM-DEBUG.LOGを:

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 run-script [ 'prestart', 'start', 'poststart' ] 
5 info lifecycle [email protected]~prestart: [email protected] 
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing 
7 info lifecycle [email protected]~start: [email protected] 
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true 
9 verbose lifecycle [email protected]~start: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\user\Desktop\angular-2\angular-quickstart\node_modules\.bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\nodejs\;C:\Users\user\AppData\Local\atom\bin;C:\Users\user\AppData\Roaming\npm 
10 verbose lifecycle [email protected]~start: CWD: C:\Users\user\Desktop\angular-2\angular-quickstart 
11 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'tsc && concurrently "tsc -w" "lite-server" ' ] 
12 silly lifecycle [email protected]~start: Returned: code: 2 signal: null 
13 info lifecycle [email protected]~start: Failed to exec start script 
14 verbose stack Error: [email protected] start: `tsc && concurrently "tsc -w" "lite-server" ` 
14 verbose stack Exit status 2 
14 verbose stack  at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16) 
14 verbose stack  at emitTwo (events.js:106:13) 
14 verbose stack  at EventEmitter.emit (events.js:191:7) 
14 verbose stack  at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14) 
14 verbose stack  at emitTwo (events.js:106:13) 
14 verbose stack  at ChildProcess.emit (events.js:191:7) 
14 verbose stack  at maybeClose (internal/child_process.js:877:16) 
14 verbose stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 
15 verbose pkgid [email protected] 
16 verbose cwd C:\Users\user\Desktop\angular-2\angular-quickstart 
17 error Windows_NT 6.1.7601 
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 
19 error node v6.9.1 
20 error npm v3.10.8 
21 error code ELIFECYCLE 
22 error [email protected] start: `tsc && concurrently "tsc -w" "lite-server" ` 
22 error Exit status 2 
23 error Failed at the [email protected] start script 'tsc && concurrently "tsc -w" "lite-server" '. 
23 error Make sure you have the latest version of node.js and npm installed. 
23 error If you do, this is most likely a problem with the angular-quickstart package, 
23 error not with npm itself. 
23 error Tell the author that this fails on your system: 
23 error  tsc && concurrently "tsc -w" "lite-server" 
23 error You can get information on how to open an issue for this project with: 
23 error  npm bugs angular-quickstart 
23 error Or if that isn't available, you can get their info via: 
23 error  npm owner ls angular-quickstart 
23 error There is likely additional logging output above. 
24 verbose exit [ 1, true ] 

他のもの:tsconfig.jsonの「target」オプションを「es5」から「es6」に変更すると、アプリが実行を開始します。 助けてください。 compilerOptions中のTSconfigで

+0

あなたは 'NPMのinstall'をしましたか? – prakharsingh95

+0

はい、カップル: – beqa

答えて

1
npm install --save-dev @types/core-js 

追加:

"typeRoots": [ 
    "../node_modules/@types" 
], 
"types": [ 
    "core-js" 
] 
+0

ありがとう、それはうまくいきます。私は何が間違っているのか、この行は何をしているのか説明してください。 – beqa