【问题标题】:cannot start angular-phonecat, postinstall script failing [closed]无法启动 angular-phonecat,安装后脚本失败 [关闭]
【发布时间】:2014-07-09 22:36:21
【问题描述】:

我目前正在设置一个 vagrant box 用于开始开发实验性 node.js + angularjs 应用程序。由于我刚开始使用 angular,我想第一次尝试 angular-phonecat 应用程序,该应用程序由 google 作为教程提供。

我在客户机中安装了节点,同步文件夹是我克隆 angular-phonecat github 存储库的位置(在主机上,但由于它已同步,这应该没关系)。换句话说: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

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

【问题讨论】:

    标签: angularjs npm bower


    【解决方案1】:

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

    来宾计算机上未安装 Git。我在尝试运行“bower install”时发现了这一点。

    虽然按照 angular-phonecat 教程中给出的步骤不需要客户机上的 git,但 bower 使用它来获取依赖项,并且它的缺失导致安装后脚本失败。

    【讨论】:

      猜你喜欢
      • 2014-11-20
      • 1970-01-01
      • 2015-03-03
      • 2017-08-02
      • 1970-01-01
      • 2019-12-22
      • 1970-01-01
      • 2015-02-11
      • 1970-01-01
      相关资源
      最近更新 更多