nvm: Failed to connect to raw.githubusercontent.com port 443: Connection timed out

Operating system and version: WSL2 Ubuntu 20.04.1 LTS

nvm debug output:


nvm ls output:


How did you install nvm?

installed using the following link curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

this is the error message after trying to connect for 32 seconds

Failed to connect to raw.githubusercontent.com port 443: Connection timed out

What steps did you perform?

Somehow unable to connect.

What happened?

I also tried copying the sh script from website into ubuntu and ran bash on the script. This got me the following: => Downloading nvm from git to ‘/home/kscephalo/.nvm’ => Cloning into ‘/home/kscephalo/.nvm’… fatal: unable to access ‘https://github.com/nvm-sh/nvm.git/’: Failed to connect to github.com port 443: Connection timed out Failed to clone nvm repo. Please report this!

What did you expect to happen?

Is there anything in any of your profile files that modifies the PATH?

If you are having installation issues, or getting “N/A”, what does curl -I --compressed -v https://nodejs.org/dist/ print out?

Print out: * TCP_NODELAY set * Immediate connect fail for 2606:4700:10::6814:162e: Network is unreachable

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 70 (12 by maintainers)

Most upvoted comments

change dns to 8.8.8.8

In case you are behind a proxy, try this:

sudo vim /etc/hosts

add this line and :wq from vim 😃

199.232.28.133 raw.githubusercontent.com

For anyone else that may come here, all I needed to do was reinstall wget on my WSL 2 instance (since I guess the one that comes with at least Ubuntu 20.04 is… outdated?).

So:

$ sudo apt remove wget
$ sudo apt install wget

https://github.com/WhitewaterFoundry/Fedora-Remix-for-WSL/issues/10#issuecomment-453712145

I also have this issue and I also think it has to do with WSL version 2, anyone know a fix ?

In case you are behind a proxy, try this:

sudo vim /etc/hosts

add this line and :wq from vim 😃

199.232.28.133 raw.githubusercontent.com

For me only this solution worked. Even after updating DNS servers to 1.1.1.1/8.8.8.8 , the hosts which my command was trying to reach were apparently unreachable (couldn’t ping them either). This solution worked.

This worked for me, Open the /etc/hosts file using sudo nano /etc/hosts command

then enter the password and add the following IP address at the end of the file,

185.199.108.133 raw.githubusercontent.com

then save and exit

now execute the homebrew installation command line .

I also had this problem with a new wsl install the steps i did to resolve was: echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null

then

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash

check the firewall is not blocking the connection, allow incoming connections

are you in China lol 199.232.28.133 raw.githubusercontent.com works for me

change dns to 8.8.8.8

It works. you will have to close all opened terminals, and add this dns settings. Then try curl. That’s it.

I disabled IPv6 just in case on Ubuntu via WSL terminal and still not working, so not sure. Also not behind a VPN.

change dns to 8.8.8.8

Changing ISP DNS to Google public DNS(8.8.4.4) worked for me. Try this!

I do not if this is the correct solution.

Because https://raw.githubusercontent.com/ is blocked by many ISPs in India.

I got this working by changing the default dns to 1.1.1.1

Screenshot 2022-12-19 at 5 35 32 PM

This worked for me, Open the /etc/hosts file using sudo nano /etc/hosts command

then enter the password and add the following IP address at the end of the file,

185.199.108.133 raw.githubusercontent.com

then save and exit

now execute the homebrew installation command line .

this worked like a charm , thanks so much!!!1

In case you are behind a proxy, try this:

sudo vim /etc/hosts

add this line and :wq from vim 😃

199.232.28.133 raw.githubusercontent.com

Yes, this also works for me, thank you very much!

sudo apt install wget

That also worked for me. Thanks a lot!

Yes thank you, I did in both WSL and WSL2 repos. Thanks for your help!

None of these things solved this issue, will probably revert to WSL1

That suggests that perhaps there’s an SSL issue on your machine, but then I’d expect an SSL error and not a “timed out” error.

It really doesn’t make sense that that 404s; it’s a 200 for me. However, the connection worked - does the install script still fail in the same way?

Do you perhaps have some kind of proxy set up with your git config that wouldn’t be applying to curl?