2017-01-25 17 views
0

人、Npm run startエラーが返される

私は基本的なangularjs 2.0のスキルを学ぶチュートリアルに従っています。私の場合は

npm run start 

は機能しませんでした。現在のバージョンのWindows 10 OSでgit bashを使用しています。ここで [email protected] [email protected]

は私のpackage.jsonの内容です:

{ 
    "name": "app", 
    "version": "0.0.1", 
    "description": "Angular 2.0 Setup auf Basis von node js und system js", 
    "main": "index.js", 
    "scripts": { 
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\"", 
    "test": "echo \"Error: no test specified\" && exit 1", 
    "postinstall": "typings install", 
    "tsc": "tsc", 
    "tsc:w": "tsc -w", 
    "typings": "typings", 
    "lite": "lite-server" 
    }, 
    "keywords": [ 
    "Angular", 
    "2.0", 
    "Setup" 
    ], 
    "author": "Martin Piontek", 
    "license": "ISC", 
    "devDependencies": { 
    "concurrently": "^3.1.0", 
    "lite-server": "^2.2.2", 
    "typescript": "^2.1.5", 
    "typings": "^2.1.0" 
    }, 
    "dependencies": { 
    "@angular/common": "^2.4.4", 
    "@angular/compiler": "^2.4.4", 
    "@angular/core": "^2.4.4", 
    "@angular/http": "^2.4.4", 
    "@angular/platform-browser": "^2.4.4", 
    "@angular/platform-browser-dynamic": "^2.4.4", 
    "@angular/router": "^3.4.4", 
    "core-js": "^2.4.1", 
    "reflect-metadata": "^0.1.9", 
    "rxjs": "^5.0.3", 
    "systemjs": "^0.20.0", 
    "zone.js": "^0.7.6" 
    } 
} 

そしてここでは、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 'run', 
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\mpion\Desktop\angulartraining\0000\setup\node_modules\.bin;C:\Users\mpion\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\mpion\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Users\mpion\AppData\Local\Microsoft\WindowsApps;C:\Users\mpion\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl 
10 verbose lifecycle [email protected]~start: CWD: C:\Users\mpion\Desktop\angulartraining\0000\setup 
11 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 
11 silly lifecycle 'tsc && concurrently "npm run tsc:w" "npm run lite"' ] 
12 silly lifecycle [email protected]~start: Returned: code: 1 signal: null 
13 info lifecycle [email protected]~start: Failed to exec start script 
14 verbose stack Error: [email protected] start: `tsc && concurrently "npm run tsc:w" "npm run lite"` 
14 verbose stack Exit status 1 
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\mpion\Desktop\angulartraining\0000\setup 
17 error Windows_NT 10.0.14393 
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start" 
19 error node v6.9.4 
20 error npm v3.10.10 
21 error code ELIFECYCLE 
22 error [email protected] start: `tsc && concurrently "npm run tsc:w" "npm run lite"` 
22 error Exit status 1 
23 error Failed at the [email protected] start script 'tsc && concurrently "npm run tsc:w" "npm run lite"'. 
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 app package, 
23 error not with npm itself. 
23 error Tell the author that this fails on your system: 
23 error  tsc && concurrently "npm run tsc:w" "npm run lite" 
23 error You can get information on how to open an issue for this project with: 
23 error  npm bugs app 
23 error Or if that isn't available, you can get their info via: 
23 error  npm owner ls app 
23 error There is likely additional logging output above. 
24 verbose exit [ 1, true ] 
の内容です

今後の進め方についてお役立て情報をお寄せください。さらに詳しい情報が必要な場合は、私に相談してください。

私はこのためにとても申し訳ありません: - tsconfig.jsonの

コンテンツファイル

{ 
    "compilerOptions": { 
     "module": "commonjs", 
     "target": "es5", 
     "noImplicitAny": false, 
     "sourceMap": true, 
     "moduleResolutions": "node", 
     "emitDecoratorMetadata": true, 
     "experimentalDecorators": true, 
     "removeComments": false 
    } 
} 

tsconfig.jsonで私のタイプミスをデバッグした後、私はこの出力を持っています!私はさらに一歩だように思えるが、今npm run startを実行した後、別のエラーがあります:

Error occured when executing command: npm run tsc:w 
Error: Unable to detect platform shell type. Please set SHELL_EXECUTE_FLAG env variable. 
    at detectExecuteFlag (C:\Users\mpion\Desktop\angulartraining\0000\setup\node_modules\spawn-default-shell\src\get-shell.js:29:9) 
    at getShell (C:\Users\mpion\Desktop\angulartraining\0000\setup\node_modules\spawn-default-shell\src\get-shell.js:37:18) 
    at Object.spawn (C:\Users\mpion\Desktop\angulartraining\0000\setup\node_modules\spawn-default-shell\src\index.js:5:24) 
    at C:\Users\mpion\Desktop\angulartraining\0000\setup\node_modules\concurrently\src\main.js:192:34 
    at arrayMap (C:\Users\mpion\Desktop\angulartraining\0000\setup\node_modules\lodash\lodash.js:660:23) 
    at Function.map (C:\Users\mpion\Desktop\angulartraining\0000\setup\node_modules\lodash\lodash.js:9571:14) 
    at run (C:\Users\mpion\Desktop\angulartraining\0000\setup\node_modules\concurrently\src\main.js:181:22) 
    at main (C:\Users\mpion\Desktop\angulartraining\0000\setup\node_modules\concurrently\src\main.js:61:5) 
    at Object.<anonymous> (C:\Users\mpion\Desktop\angulartraining\0000\setup\node_modules\concurrently\src\main.js:421:1) 
    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) 
+0

'npm run tsc:w'と' npm run lite'をチェックしようとすると、エラーを返す可能性があります。 –

+0

'npm run tsc:w'と入力すると、コンソールにログが記録されます。 エラーTS5023:未知のコンパイラオプション 'moduleResolutions'。 –

+0

'tsconfig.json'に問題があります。質問の内容を追加してください。 –

答えて

1

あなたはtsconfig.json内のタイプミスを持っているが。

moduleResolutionsからmoduleResolutionに変更してください。

+0

私はとても残念です!しかし、タイプミスをデバッグした後に、別のエラー出力があります。私は最初の投稿に追加しました。 –

+0

@ MartinP。 'export SHELL =/bin/bash(あなたのパスはbashに)'だが、ウィンドウを使っているので、バッチのパスが分からない。 –

+0

このパスを修正する必要があるのはどこのファイルですか(これはgit bashで解決する必要がありますか?)。 –

関連する問題