nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot Install nvm on ubuntu

ANUJSP25 opened this issue · comments

Operating system and version:

Ubuntu 22.04.1

nvm debug output:

nvm ls output:

How did you install nvm?

What steps did you perform?

I just ran this line of code "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash"

What happened?

I got this error after the timer stopped and nothing was downloaded
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:02:10 --:--:-- 0
curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 130204 ms: Connection timed out

What did you expect to happen?

I expected that it would install nvm

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

I'm not sure...

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

curl -I --compressed -v https://nodejs.org/dist/ * Trying 104.20.23.46:443... * Connected to nodejs.org (104.20.23.46) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * CAfile: /etc/ssl/certs/ca-certificates.crt * CApath: /etc/ssl/certs * TLSv1.0 (OUT), TLS header, Certificate Status (22): * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS header, Certificate Status (22): * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS header, Finished (20): * TLSv1.2 (IN), TLS header, Supplemental data (23): * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8): * TLSv1.3 (IN), TLS handshake, Certificate (11): * TLSv1.3 (IN), TLS handshake, CERT verify (15): * TLSv1.3 (IN), TLS handshake, Finished (20): * TLSv1.2 (OUT), TLS header, Finished (20): * TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1): * TLSv1.2 (OUT), TLS header, Supplemental data (23): * TLSv1.3 (OUT), TLS handshake, Finished (20): * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 * ALPN, server accepted to use h2 * Server certificate: * subject: CN=*.nodejs.org * start date: Jan 11 00:00:00 2022 GMT * expire date: Feb 11 23:59:59 2023 GMT * subjectAltName: host "nodejs.org" matched cert's "nodejs.org" * issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA * SSL certificate verify ok. * Using HTTP2, server supports multiplexing * Connection state changed (HTTP/2 confirmed) * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 * TLSv1.2 (OUT), TLS header, Supplemental data (23): * TLSv1.2 (OUT), TLS header, Supplemental data (23): * TLSv1.2 (OUT), TLS header, Supplemental data (23): * Using Stream ID: 1 (easy handle 0x555ffbab7550) * TLSv1.2 (OUT), TLS header, Supplemental data (23): > HEAD /dist/ HTTP/2 > Host: nodejs.org > user-agent: curl/7.81.0 > accept: */* > accept-encoding: deflate, gzip, br, zstd > * TLSv1.2 (IN), TLS header, Supplemental data (23): * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): * old SSL session ID is stale, removing * TLSv1.2 (IN), TLS header, Supplemental data (23): * Connection state changed (MAX_CONCURRENT_STREAMS == 256)! * TLSv1.2 (OUT), TLS header, Supplemental data (23): * TLSv1.2 (IN), TLS header, Supplemental data (23): < HTTP/2 200 HTTP/2 200 < date: Sun, 18 Dec 2022 18:47:26 GMT date: Sun, 18 Dec 2022 18:47:26 GMT < content-type: text/html content-type: text/html < last-modified: Sun, 18 Dec 2022 14:35:12 GMT last-modified: Sun, 18 Dec 2022 14:35:12 GMT < cache-control: max-age=14400 cache-control: max-age=14400 < cf-cache-status: HIT cf-cache-status: HIT < age: 1625 age: 1625 < vary: Accept-Encoding vary: Accept-Encoding < strict-transport-security: max-age=31536000; includeSubDomains; preload strict-transport-security: max-age=31536000; includeSubDomains; preload < x-content-type-options: nosniff x-content-type-options: nosniff < server: cloudflare server: cloudflare < cf-ray: 77ba11260bbb8b09-BOM cf-ray: 77ba11260bbb8b09-BOM < content-encoding: br content-encoding: br

<

  • Connection #0 to host nodejs.org left intact

This looks like you're having difficulty connecting to github - if you can't download the install script then certainly nothing will install.

Can you try curl -I --compressed -v https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh as well?

I tried this "curl -I --compressed -v https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh" today but still I'm getting these errors,
curl -I --compressed -v https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh

  • Trying 49.44.79.236:443...
  • Trying 2405:200:1607:2820:41::36:443...
  • Immediate connect fail for 2405:200:1607:2820:41::36: Network is unreachable
  • connect to 49.44.79.236 port 443 failed: Connection timed out
  • Failed to connect to raw.githubusercontent.com port 443 after 133746 ms: Connection timed out
  • Closing connection 0
    curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 133746 ms: Connection timed out

Seems like your internet connection has some issues. It could be your workplace/school, your ISP, or your government, but this isn't really something I can help you debug, unfortunately.

Same issue basically.

root@husky:~# curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15916  100 15916    0     0   109k      0 --:--:-- --:--:-- --:--:--  109k
=> Downloading nvm from git to '/root/.nvm'
=> Cloning into '/root/.nvm'...
error: git-remote-https died of signal 4
Failed to clone nvm repo. Please report this!
root@husky:~# 

It's 22.04 as-well.

@Itz-Hyperz same comment to you - can you clone the nvm repo by itself?

Hey there, I was too unable to clone and install nvm in my device. It seems like a government thing. The address is blocked all together. I used vpn and was able to install nvm properly. Let me know if it works for you too. 👍🏼

I agree that's likely what it is, so I'm going to close this. I believe India has recently blocked githubusercontent.com, so I'd suggest a vpn, or advocating to your government, if this affects you.

@ANUJSP25 curl just can't find the link, just download the install.sh file manually from this link
and just runbash install.sh on your linux terminal and Thank me later :)