由于git错误,无法启动ember-cli项目

时间:2014-10-28 10:48:06

标签: git ember.js bower ember-cli

当我尝试执行ember new myproject时,我得到以下内容:

[ ... snip ...]
  create vendor/.gitkeep
Installed packages for tooling via npm.
Failed to execute "git ls-remote --tags --heads git://github.com/stefanpenner/ember-load-initializers.git", exit code of #128
Error: Failed to execute "git ls-remote --tags --heads git://github.com/stefanpenner/ember-load-initializers.git"
 exit code of #128
    at createError (/usr/local/lib/node_modules/ember-cli/node_modules/bower/lib/util/createError.js:4:15)
    [ ... snip ...]

所以我尝试执行失败的命令:

$ git ls-remote --tags --heads git://github.com/stefanpenner/ember-load-initializers.git
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=Operation timed out

git://github.com语法对我来说是新的,所以我尝试了一个更熟悉git@github.com:的版本:

$ git ls-remote --tags --heads git@github.com:stefanpenner/ember-load-initializers.git                                                                                        
3a6dc87e29efc9de4bc42b6f9afedabb000bcc89        refs/heads/master
be13fa4a45abff2c9fcfc82497668ed2a925a856        refs/tags/0.0.1
3a6dc87e29efc9de4bc42b6f9afedabb000bcc89        refs/tags/v0.0.2
$

有人可以帮我诊断这个问题吗?我对git解决方案or an ember`解决方法感到满意。

修改

我试过了:

$ ember new myproject --skip-git

具有相同的结果。我也试过了

$ ember new myproject --skip-bower

似乎竞争成功,但随后在$ ember serve上出错,抱怨缺乏凉亭组件。

如果我再尝试:

$ bower install

然后我遇到了同样的git://问题。所以我猜这真的是一个bower / git问题。仍然欣赏建议。

4 个答案:

答案 0 :(得分:3)

这往往是防火墙的问题。验证您的防火墙是否会让您访问git://域。当我运行命令时,我得到了

$ git ls-remote --tags --heads git://github.com/stefanpenner/ember-load-initializers.git
3a6dc87e29efc9de4bc42b6f9afedabb000bcc89        refs/heads/master
be13fa4a45abff2c9fcfc82497668ed2a925a856        refs/tags/0.0.1
3a6dc87e29efc9de4bc42b6f9afedabb000bcc89        refs/tags/v0.0.2

答案 1 :(得分:3)

我遇到了同样的问题,并通过向.bowerrc

显式添加空代理设置解决了这个问题
$ ember new myproject --skip-bower

然后我编辑了项目中的.bowerrc,如下所示:

{
  "directory": "bower_components",
  "analytics": false,
  "proxy":"",
  "https-proxy":""
}

最后做了一个

$ bower install

然后工作正常。

答案 2 :(得分:0)

检查一下: git:// protocol blocked by company, how can I get around that?

所以,回答你的问题:

 $ git ls-remote --tags --heads git://github.com/stefanpenner/ember-load-initializers.git
 ...Connection timed out
 $ git config --global url."https://".insteadOf git://
 $ git ls-remote --tags --heads git://github.com/stefanpenner/ember-load-initializers.git
2ac2abfa69f9ea682a7461fd6c46a96a56c276fd    refs/heads/master
be13fa4a45abff2c9fcfc82497668ed2a925a856    refs/tags/0.0.1
3a6dc87e29efc9de4bc42b6f9afedabb000bcc89    refs/tags/v0.0.2

有人可能会争辩说,打开到端口TCP 9148的传出连接将是更好的解决方案,但这是SO。不是那个被称为ServerFault的流氓国家

(我小子:https://serverfault.com/questions/189070/what-firewall-ports-need-to-be-open-to-allow-access-to-external-git-repositories

答案 3 :(得分:-1)

如果您遇到问题,请使用--skip-git参数,并在以后手动处理版本控制。

另请参阅:$ ember help new