nvm icon indicating copy to clipboard operation
nvm copied to clipboard

Cant install on ubuntu 20.0.4

Open augchan42 opened this issue 3 years ago • 7 comments

Operating system and version:

Ubuntu 20.0.4

nvm debug output:


nvm ls output:


How did you install nvm?

What steps did you perform?

What happened?

osboxes@osboxes:~$ ./install.sh => Downloading nvm as script to '/home/osboxes/.nvm' Failed to download 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/nvm.sh'

Failed to download 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/bash_completion' Failed to download 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/nvm-exec' => nvm source string already in /home/osboxes/.bashrc => bash_completion source string already in /home/osboxes/.bashrc ./install.sh: line 435: /home/osboxes/.nvm/nvm.sh: No such file or directory => Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion

What did you expect to happen?

Install script should work

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?


augchan42 avatar Jan 18 '22 05:01 augchan42

Those “failed to download” messages are the issue.

Are you able to connect to GitHub on the command line?

Also, please answer every question on the template - especially the last one.

ljharb avatar Jan 18 '22 05:01 ljharb

I can confirm this exact error happens when you're not logged in to GitHub CLI context (then you cannot download nvm binaries). After logging in nvm installs without issues

medikoo avatar Mar 22 '22 20:03 medikoo

@medikoo i'm confused; what does "logged in" mean on the shell? nvm doesn't use the github CLI at all, it just uses curl.

ljharb avatar Mar 22 '22 20:03 ljharb

@ljharb I've looked deeper, and indeed it's confusing. What I can confirm on

If you install curl via snap on Ubuntu, you'll get above error when trying to install nvm Installing gh CLI and authenticating via gh auth login, unblocked the install of nvm (but I can't explain why), Stil after that, I still approach another problem described here: https://github.com/nvm-sh/nvm/issues/2771

There are no issues with nvm installation (no need for GitHub authentication) or usage if curl is installed via apt on Ubuntu

medikoo avatar Mar 22 '22 20:03 medikoo

@medikoo Thanks for that debugging. is there a linked issue for snap's curl?

@augchan42 any chance you're using curl installed via snap?

ljharb avatar Mar 22 '22 20:03 ljharb

I had the same error or similar error:

erp@erp-cypress:~$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15037  100 15037    0     0   407k      0 --:--:-- --:--:-- --:--:--  407k
=> Downloading nvm from git to '/home/erp/.nvm'
=> Cloning into '/home/erp/.nvm'...
fatal: remote error:
  /nvm-sh/nvm is not a valid repository name
  Visit https://support.github.com/ for help
Failed to clone nvm repo. Please report this!
erp@erp-cypress:~$ wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
=> Downloading nvm from git to '/home/erp/.nvm'
=> Cloning into '/home/erp/.nvm'...
fatal: remote error:
  /nvm-sh/nvm is not a valid repository name
  Visit https://support.github.com/ for help
Failed to clone nvm repo. Please report this!
erp@erp-cypress:~$

and it was due to this: git config --global -e

[url "ssh://[email protected]/"]
        insteadOf = https://github.com

Removing those two lines out of the git config fixed it.

We'd been told by a consultant that we needed to migrate to SSH, and indeed, that worked for a while until it didn't ...

Maybe a note in the install doc?

jgwinner avatar Apr 13 '22 00:04 jgwinner

You should use SSH for repos, by changing each individual repo’a remote - i wasn’t aware of that git config option but either way, your config was broken because one had a trailing slash, and the other didn’t.

ljharb avatar Apr 13 '22 01:04 ljharb