无法启动angular-phonecat,postinstall脚本失败

时间:2014-06-24 19:16:04

标签: angularjs npm bower

我目前正在设置一个流浪盒,用于开始实验node.js + angularjs app的开发。由于我刚开始使用angular,我想首先尝试使用angular-phonecat应用程序,这是谷歌提供的教程。

我在来宾计算机中安装了节点,并且同步文件夹是我克隆angular-phonecat github repo的地方(在主机上,但是因为它同步了,所以这不重要)。换句话说:repo中的所有文件也存在于我的文件系统中。

我按照https://docs.angularjs.org/tutorial中提到的步骤(步骤0)。当然,我在客户机上安装了节点。

问题出现在我第一次运行" npm install"之后。安装后脚本失败,因此在此之后缺少某些依赖项。我可以启动服务器并从我的主机访问它,在那里我看到尝试从我的主机上获取jquery和其他库时有404错误。当然他们不在那里,尽管我可以手动放置它们,但这不是应该的方式。

这是我得到的错误

npm ERR! angular-phonecat@0.0.0 postinstall: `bower install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the angular-phonecat@0.0.0 postinstall 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!     bower install
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! System Linux 3.2.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /vagrant/angular-phonecat
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /vagrant/angular-phonecat/npm-debug.log
npm ERR! not ok code 0

如果我执行错误建议以便追踪它,我会

vagrant@precise64:/vagrant/angular-phonecat$ npm owner ls angular-phonecat 
npm ERR! owner ls Couldn't get owner data angular-phonecat
npm ERR! 404 404 Not Found: angular-phonecat
npm ERR! 404 
npm ERR! 404 'angular-phonecat' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Linux 3.2.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "owner" "ls" "angular-phonecat"
npm ERR! cwd /vagrant/angular-phonecat
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code E404
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /vagrant/angular-phonecat/npm-debug.log
npm ERR! not ok code 0

所以我有点卡住,因为我不知道如何解释这第二条消息。有任何想法吗?那边有类似问题的人?

1 个答案:

答案 0 :(得分:0)

已经找到了。我正在追踪错误的线索。

客户机未安装Git。当我试图运行" bower install"时,我发现了这个。

虽然没有必要使用客户端机器上的git来执行angular-phonecat教程中给出的步骤,但是bower使用git来获取依赖项,但它的缺失导致安装后脚本失败。

相关问题