2016-10-11 10 views
3

に開始したとき、私は "私は、コマンドを実行すると、私はエラーを取得していますhttps://github.com/michaelcheng429/super-mean-stackNODE_PATHは、NPMは、Windows 10

package.json

{ 
"name": "ToDoThoughts", 
"version": "1.0.0", 
"description": "", 
"main": "index.js", 
"scripts": { 
    "start": "NODE_PATH=$NODE_PATH:./app node server", 
    "dev": "npm start & webpack-dev-server --progress --colors" 
}, 
"license": "ISC", 
"dependencies": { 
    "angular": "1.4.12", 
    "angular-ui-router": "0.3.1", 
    "body-parser": "1.15.2", 
    "bootstrap": "3.3.7", 
    "express": "4.14.0" 
}, 
"devDependencies": { 
    "babel-core": "6.17.0", 
    "babel-preset-es2015": "6.16.0", 
    "raw-loader": "0.5.1", 
    "webpack": "1.13.2", 
    "webpack-dev-server": "1.16.2" 
}, 
"engines": { 
    "node": "5.5.0" 
} 
} 

に従うことによって構築されたMEAN藤堂アプリにしようとしていますエラーがスローされますコマンドプロンプトでnpm run dev "を入力します。 私もインストール上のノードは、あなたのシステム環境変数にインストールする必要があり、使用して呼び出されるべき

> [email protected] start C:\Projects\ToDoThoughts 
> NODE_PATH=$NODE_PATH:./app node server 

'NODE_PATH' is not recognized as an internal or external command, 
operable program or batch file. 

npm ERR! Windows_NT 10.0.14393 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Selva\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start" 
npm ERR! node v6.5.0 
npm ERR! npm v3.10.8 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] start: `NODE_PATH=$NODE_PATH:./app node server` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] start script 'NODE_PATH=$NODE_PATH:./app node server'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the ToDoThoughts package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  NODE_PATH=$NODE_PATH:./app node server 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs ToDoThoughts 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls ToDoThoughts 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\Projects\ToDoThoughts\npm-debug.log 

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:\\Users\\Selva\\AppData\\Roaming\\npm\\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:\Users\Selva\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Projects\ToDoThoughts\node_modules\.bin;C:\Users\Selva\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Projects\ToDoThoughts\node_modules\.bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Skype\Phone\;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\Selva\AppData\Local\Microsoft\WindowsApps;C:\Users\Selva\AppData\Roaming\npm;C:\Users\Selva\AppData\Local\atom\bin;C:\Program Files\Git\bin;C:\Projects\ToDoThoughts 
10 verbose lifecycle [email protected]~start: CWD: C:\Projects\ToDoThoughts 
11 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'NODE_PATH=$NODE_PATH:./app node server' ] 
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: `NODE_PATH=$NODE_PATH:./app node server` 
14 verbose stack Exit status 1 
14 verbose stack  at EventEmitter.<anonymous> (C:\Users\Selva\AppData\Roaming\npm\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:\Users\Selva\AppData\Roaming\npm\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:\Projects\ToDoThoughts 
17 error Windows_NT 10.0.14393 
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Selva\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start" 
19 error node v6.5.0 
20 error npm v3.10.8 
21 error code ELIFECYCLE 
22 error [email protected] start: `NODE_PATH=$NODE_PATH:./app node server` 
22 error Exit status 1 
23 error Failed at the [email protected] start script 'NODE_PATH=$NODE_PATH:./app node 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 ToDoThoughts package, 
23 error not with npm itself. 
23 error Tell the author that this fails on your system: 
23 error  NODE_PATH=$NODE_PATH:./app node server 
23 error You can get information on how to open an issue for this project with: 
23 error  npm bugs ToDoThoughts 
23 error Or if that isn't available, you can get their info via: 
23 error  npm owner ls ToDoThoughts 
23 error There is likely additional logging output above. 
24 verbose exit [ 1, true ] 
+0

は、システムにNODE_PATHが設定されていますか? –

+0

はい。 NODE_PATH ENVIRONMENT変数は、システム内で「C:¥Users¥Selva¥AppData¥Roaming¥npm¥node_modules」に設定されています。 – user6943521

答えて

1

NPM scriptsは、NPMが呼び出されたシェルで実行されます。

NODE_PATH=$NODE_PATH:./app node serverは、WindowsのコマンドプロンプトまたはPowershellを使用している場合、正しく動作しません。既にGitがインストールされている場合は、既に利用可能なGit Bashを使用してください。

また、MSYS'またはCygwin's Bashシェルをインストールすることもできます。

0
"scripts": { 
    "start": "node server.js", 
    "dev": "start cmd /k \"webpack-dev-server --progress --colors\" & node server.js" 
    } 
+1

これにより、問題が解決されます。なぜ将来の読者のために説明してください。誰もが 'package.json'のスクリプトオプションを理解しているわけではありません。 – Dandy

1

npm.debug.log添付しましたPowerShellまたはcmdのnode

これは、環境変数にノードパスを挿入する必要はないということです。

PowerShellまたはcmdを管理者として実行していることを確認してください。これにより、システム環境変数が確実に取得されます。

最後には、あなたにpackage.json変化:

"scripts": { 
    "start": "node server.js", 
    "dev": "start cmd /k \"webpack-dev-server --progress --colors\" & node server.js" 
} 

その後、npm startを実行し、サーバーが稼働している必要があります。

関連する問題