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

标签 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

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

最佳答案

看来您还没有安装 http-server 包。

试试下面这行。如果它包含在您的 package.json 中,它应该可以工作

$ npm install

否则尝试:

$ npm install http-server

关于javascript - 无法在 AngularJS phonecat 应用程序中执行 Web 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26484415/

相关文章:

javascript - 在文本上应用 Bostock 的换行功能

javascript - AngularJS ngRepeat within Directiving using a locally defined collection

AngularJS Phonegap 上线/离线事件

javascript - Store 没有带有 mergeReducer 的有效 reducer

javascript - 如何修复 $scope 选择选项数组中的未定义结果?

javascript - 使用 AJAX 加载代码时添加 rel ="noopener"

javascript - Heroku - Socket.IO 客户端总是连接到本地主机

node.js - 创建 react 应用程序+ Visual Studio + F5 = "Unexpected token import"

javascript - 在 for 中同步进行异步调用

AngularJS "global"数据?