无法在AngularJS phonecat应用程序中执行Web服务器

时间:2014-10-21 10:25:02

标签: javascript angularjs node.js npm

我下载了AngularJS phonecat标准应用,并安装了Node。但是当我使用代码移动到目录并尝试'npm start'时,我收到以下错误:

> angular-phonecat@0.0.0 start /Users/marya/JS:HTML:CSS/angular-phonecat
> http-server -a 0.0.0.0 -p 8000

sh: http-server: command not found

npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/Cellar/nvm/0.17.2/v0.10.32/bin/npm" "start"
npm ERR! node v0.10.32
npm ERR! npm  v2.1.4
npm ERR! code ELIFECYCLE
npm ERR! angular-phonecat@0.0.0 start: `http-server -a 0.0.0.0 -p 8000`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the angular-phonecat@0.0.0 start script.
npm ERR! This is most likely a problem with the angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     http-server -a 0.0.0.0 -p 8000
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/marya/JS:HTML:CSS/angular-phonecat/npm-debug.log

这是什么意思?我该如何解决?提前致谢。

1 个答案:

答案 0 :(得分:2)

看起来好像你还没有安装http-server软件包。

请尝试下面的一行。它应该包含在你的package.json

$ npm install

否则尝试:

$ npm install http-server