developer tip

Git / Bower 오류 : 종료 코드 # 128 및 연결 실패

optionbox 2020. 9. 18. 08:06
반응형

Git / Bower 오류 : 종료 코드 # 128 및 연결 실패


Bower를 사용하여 여러 라이브러리를 설치하고 있습니다. 여기서 데모 목적으로 부트 스트랩을 설치하고 있습니다. 패키지에 관계없이 다음과 같은 오류가 발생합니다.

C:\Scott>bower install bootstrap
bower not-cached    git://github.com/twbs/bootstrap.git#*
bower resolve       git://github.com/twbs/bootstrap.git#*
bower ECMDERR       Failed to execute "git ls-remote --tags --heads git://github
.com/twbs/bootstrap.git", exit code of #128

Additional error details:
fatal: unable to access 'https://github.com/twbs/bootstrap.git/': Failed connect
to github.com:443; No error    

검색 에서 찾은 첫 번째 오류를 제거하기 위해 다음 솔루션을 사용해 보았습니다 .

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

그러나 이것은 작동하지 않으며 해당 페이지에서 찾은 다른 솔루션도 수행하지 않습니다. 두 번째 오류에 대한 솔루션을 검색하면 프록시 서버에 대한 사용자 이름 / 비밀번호를 설정하면 회사 네트워크에 있거나 방화벽 뒤에있는 경우 문제가 해결되는 것 같습니다. 그러나 홈 PC / 네트워크 (Windows 7 x64)에서와 같이 프록시 서버를 사용하지 않습니다.

감사!

편집 : 오류가있는 명령 창 :

여기에 이미지 설명 입력


이것이 문제를 "해결"하는 것이 아니라는 것을 알고 있지만

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

git에게 GIT 대신 HTTPS를 사용하도록 지시하여 npm 종속성을 설치했습니다.


대신 다음 명령을 실행하십시오.

 git ls-remote --tags --heads git://github.com/twbs/bootstrap.git

다음 명령을 실행해야합니다.

 git ls-remote --tags --heads git@github.com:twbs/bootstrap.git

또는

 git ls-remote --tags --heads https://github.com/twbs/bootstrap.git

또는 실행할 수 git ls-remote --tags --heads git://github.com/twbs/bootstrap.git있지만 git이 항상 다음과 같이 https를 사용하도록해야합니다.

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

참조 : https://github.com/bower/bower/issues/50


회사 네트워크에서 이것을 발견했습니다.

나는 항상 ssh를 사용하여 git과 연결하고 문제가 없었기 때문에 이상하게 보였습니다.

https를 시도했지만 작동하지 않았으므로 git의 구성에 프록시 설정을 추가했는데 모두 잘되었습니다.

git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
git config --global https.proxy https://proxyuser:proxypwd@proxy.server.com:8080

그리고 그것이 작동하는지 확인

git config --list

내 컴퓨터에서 포트 22가 차단되었습니다. 막고있는 것을 발견하고 포트를 열면 아무 문제없이 bower install cmd를 실행할 수있었습니다.


azsl1326이 포트 9418 (git : //)을 통해 bower (git)를 사용하지 못한 것처럼 보이며 대신 포트 22 (https : //)를 사용하도록 git에 지시했습니다. 이것은 여전히 ​​실패했지만 포트 22를 여는 것은 원하는 결과를 얻었습니다.

가장 직접적인 해결책은 포트 9418을 여는 것입니다. 이것은 git : // 프로토콜이 사용하는 포트입니다.


응용 프로그램 폴더로 이동하여이 명령을 실행하십시오.

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

"

문제가 해결됩니다.


아마도 ssh 키생성 해야 github로 인증을받을 수 있습니다.


방화벽 뒤에 있습니까?

Git은 호출 될 때 프록시 구성을 선택하지 않으므로 환경 변수를 명시 적으로 설정합니다. 예 :

export HTTP_PROXY=http://username:password@proxyserver:port/
export HTTPS_PROXY=http://username:password@proxyserver:port/

회사 프록시에 인증이 필요하지 않은 username:password@경우 URL 에서 비트를 생략하십시오 .

그것은 나를 위해 일했습니다!


If your country block github, e.g. China mainland, then you can build a proxy, e.g. use goagent & gae, then set proxy address for git, e.g.

git config --global http.proxy 127.0.0.1:8087

This error is related to a bad configuration of your firewall. You will notice that bower trying to contact git via the git:// protocol and not http://. You have to open port 9418. Add this two lines in your iptables configuration :

iptables -t filter -A INPUT -p tcp --dport 9418 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp --dport 9418 -j ACCEPT

This should do the trick.


Firstly, you should check if Visual Studio Command prompt recognizes git command: Tools > Command Line

C:\....\> git

if this command is not recognized, you should add git folder into Environment Variables

https://stackoverflow.com/a/26620861/3449657

This is what I was missing and did the trick for me.

Hope it helps.


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 got this error after my virus checker had quarantined a download from github.com. For some unknown reason.

After I cleared those files (exe files) everything worked.


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.


Check your git config settings (git config --global --edit). In my case there were a couple of no longer valid entries like:

[core]
gitproxy=gitproxy.cmd
["https://"]
["https://"]
[url "https://"]

Revise them and remove if you don't need them anymore.


Your keys are wrong. Just add them to GitHub/Bitbucket/whatever you are using. It's nothing more than a permission issue with your keys.


However, I am not using a proxy server as I am on my home pc/network

Had the same problem (getting exit code 128) on my home network and was quite sure i was not using a proxy. Turns out, Git had saved a proxy i had entered some time in the past - after looking around in the configs, i found it under the [http] tag.

I'm new to Git, and i'm not at all sure, if those configs are usually easily accessible - am using Tortoise Git, since i'm not doing anything fancy really and that has a GUI for the things.

Hope the "answer" helps nonetheless.


In my case was the folder access where i was during the command execution! On windows I created the folder first by command line: mkdir "MyFolder" and I had the error. but if I create the folder with the mouse, right click, create folder etc. Works fine!


If you are authenticating with bitbucket, where I'm getting error 128 & Failed connect. but when using authenticating git hub its working fine.


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


This worked for me,

Copy the file "libcurl.dll" in Git installation folder ( C:\Program Files\Git\bin\libcurl.dll ). Paste it in location where the git.exe exists ( C:\Program Files\Git\libexec\git-core ).


Run these 2 commands to grant git access via your system

eval `ssh-agent`
ssh-add ~/.ssh/id_rsa

These commands are assuming that you have ssh key over the remote git server(bitbucket/github/other)


이 오류도 발생하여 git을 업데이트하여 해결했습니다. 실패한 git ls-remote 명령을 실행했을 때 기본 오류는 이전 tls 버전이 사용 중이라는 것입니다. 따라서 업데이트 된 버전의 git은 이후 버전의 tls를 사용합니다.

https://git-scm.com/download/win


내 리눅스 OS 에서이 오류를 발견했습니다. 이 문제를 해결합니다. 1. curl log export GIT_CURL_VERBOSE = 1을 엽니 다. 2.clone git repo 3. 로그를 찾습니다. 4. nss 및 curl을 업데이트하여 문제를 수정합니다 (yum update nss nss-util nspr curl).

참고 URL : https://stackoverflow.com/questions/21544803/git-bower-errors-exit-code-128-failed-connect

반응형