【问题标题】:Bower install Libraries IssuesBower 安装库问题
【发布时间】:2015-02-09 14:26:40
【问题描述】:

我正在使用 bower 在我的项目中安装依赖项和各种库。但我遇到了一个致命错误。 URL 的 git:// 部分似乎被替换为 insteadof

我正在使用 Mac OS XTerminal 执行命令。

有什么解决办法吗?

pdc1-4s6zyr1:~ administrator$ bower install **git://github.com/jquery/jquery.git**
bower not-cached    git://github.com/jquery/jquery.git#*
bower resolve       git://github.com/jquery/jquery.git#*
bower ECMDERR       Failed to execute "git ls-remote --tags --heads git://github.com/jquery/jquery.git", exit code of #128

Additional error details:
fatal: '.insteadofgithub.com/jquery/jquery.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

谢谢, 安吉坦纳

【问题讨论】:

  • 你能发布你的 bower.json 吗?

标签: javascript git command-line terminal bower


【解决方案1】:

打开你的终端并写下这个:

git config --global url."https://".insteadOf git://

这将强制 git 替换协议。

此外,如果您在 bower.json 中包含 github 存储库,您可以尝试将文件中的 git URL 的“https://”替换为“git://”。

【讨论】:

  • 它没有用。它仍然显示相同的错误。你知道如何彻底删除 git 配置吗?
  • @AnkitTanna 您可以查找配置文件:~/.gitconfig 并删除所有设置。您的 bower 文件可能有问题吗?
  • 嗨,问题是其中一个 url 具有空白值。刚刚添加了 https [url "https://"]
【解决方案2】:

问题的解决方法是:

找到 .gitconfig 文件

 [user]
        name = 1wQasdTeedFrsweXcs234saS56Scxs5423
        email = ankittanna@hotmail.com
    [credential]
        helper = osxkeychain
    [url ""]
        insteadOf = git://
    [url "https://"]
    [url "https://"]
        insteadOf = git://

会有一个空白的 url="" 替换为 url="https://"

[user]
    name = 1wQasdTeedFrsweXcs234saS56Scxs5423
    email = ankittanna@hotmail.com
[credential]
    helper = osxkeychain
[url "https://"]
    insteadOf = git://
[url "https://"]
[url "https://"]
    insteadOf = git://

这会起作用:)

拜拜快乐

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-16
    • 1970-01-01
    • 1970-01-01
    • 2015-05-02
    • 2015-03-05
    • 2023-03-06
    相关资源
    最近更新 更多