简体   繁体   English

Bower安装库问题

[英]Bower install Libraries Issues

I am using bower to install dependencies and various libraries in my project. 我正在使用bower在我的项目中安装依赖项和各种库。 But I am getting a fatal error. 但我得到一个致命的错误。 The URL's git:// portion seems to be replaced by insteadof 该URL的混帐://部分似乎是由与其使用替代

I am using Mac OS X and Terminal for commands. 我正在使用Mac OS X终端命令。

Is there any solution for this? 这有什么解决方案吗?

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.

Thanks, Ankit Tanna 谢谢,Ankit Tanna

Open your terminal and write this: 打开你的终端并写下:

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

This will force git replace the protocol. 这将强制git替换协议。

Also if you are including github repos in your bower.json you can try replacing 'git://' by 'https://' of git URL's in the file. 此外,如果您在bower.json中包含github repos,您可以尝试将'git://'替换为文件中git URL的'https://'。

The solution to the problem is: 该问题的解决方案是:

Find the .gitconfig file 找到.gitconfig文件

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

there would be a blank url="" replace it with url="https://" 会有一个空白的url =“”将其替换为url =“https://”

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

This will work :) 这将工作:)

Happy Bower-ing 快乐的凉亭

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM