I am using Bower to install several libraries. For demonstration purposes here, I am installing bootstrap. Regardless of the package, I receive the following errors:
git config --global url. "https://".insteadOf "git://"
was not working for me. So I found this alternative:
Go to your temp folder. ( i.e. if you are using windows then C:\Users\{username}\AppData\Roaming\bower\cache\packages
). There you can see several files. Open each of them and you can see the URL. Change it from git://...
to https://...
and save all files.
Now run the bower install
.
I came across this with my corporate network.
It seemed strange because I've always been using ssh to connect with git and never had an issue.
I tried https and didn't work so I added proxy settings to git's config and all was well
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
git config --global https.proxy https://proxyuser:proxypwd@proxy.server.com:8080
And making sure it worked
git config --list
I ran into this error too, and resolved by updating git. When I ran the failed git ls-remote command, the underlying error was that an old tls version was being used. So updated version of git uses later version of tls.
https://git-scm.com/download/win
Am adding my answer here as this is one of the closest questions that matched my situation. Was trying to install select2 rather than bootstrap, but the outcome was the same.
bower install select2
reported that git was unable to locate the directory. Used the
git config --global url."https://".insteadOf git://
config fix, but that resulted in a (paraphrased) error
I can't use https
My issue was resolved unsatisfactorily, as it involves magic.
I was attempting to run this in a command shell (cmd.exe, windows). I ran the same command and ran it in powershell and it worked. ಠ_ಠ
tl;dr: combination of https:// and powershell worked for me
I know this is an old question, anyway let me add one more thing.
Sometimes(If you are in an office or private network) your gateway server firewall block the https requests(port 443) from the command terminal
git config --global url."http://".insteadOf "https://"
Use this to config the git to use http over https for those situvations
Instead to run this command:
git ls-remote --tags --heads git://github.com/twbs/bootstrap.git
you should run this command:
git ls-remote --tags --heads git@github.com:twbs/bootstrap.git
or
git ls-remote --tags --heads https://github.com/twbs/bootstrap.git
or you can run git ls-remote --tags --heads git://github.com/twbs/bootstrap.git
but you need to make git always use https in this way:
git config --global url."https://".insteadOf git://
Reference: https://github.com/bower/bower/issues/50