2014-10-17 46 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命令重新安装和尝试。

相关问题