2014-10-17 44 views
0

我下載了Angular phonecat示例phoject,移動到此目錄並嘗試'npm start'命令。結果:無法在Angular的示例應用程序中啓動Node js服務器

0 info it worked if it ends with ok 
1 verbose cli [ 'node', 
1 verbose cli '/usr/local/Cellar/nvm/0.17.2/v0.10.32/bin/npm', 
1 verbose cli 'start' ] 
2 info using [email protected] 
3 info using [email protected] 
4 verbose run-script [ 'prestart', 'start', 'poststart' ] 
5 info prestart [email protected] 
6 verbose unsafe-perm in lifecycle true 
7 info [email protected] Failed to exec prestart script 
8 verbose stack Error: [email protected] prestart: `npm install` 
8 verbose stack Exit status 3 
8 verbose stack  at ChildProcess.<anonymous> (/usr/local/Cellar/nvm/0.17.2/v0.10.32/lib/node_modules/npm/lib/utils/lifecycle.js:212:16) 
8 verbose stack  at ChildProcess.emit (events.js:98:17) 
8 verbose stack  at maybeClose (child_process.js:756:16) 
8 verbose stack  at Process.ChildProcess._handle.onexit (child_process.js:823:5) 
9 verbose pkgid [email protected] 
10 verbose cwd /Users/marya/JS:HTML:CSS/angular-phonecat 
11 error Darwin 13.4.0 
12 error argv "node" "/usr/local/Cellar/nvm/0.17.2/v0.10.32/bin/npm" "start" 
13 error node v0.10.32 
14 error npm v2.1.4 
15 error code ELIFECYCLE 
16 error [email protected] prestart: `npm install` 
16 error Exit status 3 
17 error Failed at the [email protected] prestart script. 
17 error This is most likely a problem with the angular-phonecat package, 
17 error not with npm itself. 
17 error Tell the author that this fails on your system: 
17 error  npm install 
17 error You can get their info via: 
17 error  npm owner ls angular-phonecat 
17 error There is likely additional logging output above. 
18 verbose exit [ 1, true ] 

我不明白爲什麼,但我不能執行服務器。我該如何解決它?提前致謝。

+0

你之前運行過'npm install'嗎? – 2014-10-17 12:02:05

+0

是的,同樣的結果 – malcoauri 2014-10-17 12:39:35

+0

試過'sudo npm install'? – Ravi 2014-10-17 12:52:59

回答

0

看來節點安裝有版本[email protected]

總之,真正的情況是,NPM看起來你的package.json文件,如果您有類似

"scripts": { "start": "coffee server.coffee" } } 

然後它會這樣做。如果NPM無法找到你的啓動腳本,它不會使用在看到

node <name of your node server>.js 

和錯誤的工作

嘗試節點開始你的angular-phonecat嘗試使用npm命令重新安裝和嘗試。

相關問題