Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid index or unavailable host #130

Closed
lkonya opened this issue Jan 5, 2021 · 3 comments
Closed

Invalid index or unavailable host #130

lkonya opened this issue Jan 5, 2021 · 3 comments

Comments

@lkonya
Copy link

lkonya commented Jan 5, 2021

Whenever I try to nvm install or nvm install v12.20.0 I receive the same error message:

~/.config/fish/functions/_nvm_index_update.fish (line 7): Invalid redirection target: 
    ' >$index.temp && command mv $index.temp $index && return
      ^
in function '_nvm_index_update'
        called on line 32 of file ~/.config/fish/functions/nvm.fish
in function 'nvm' with arguments 'install v12.20.0'
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory
nvm: Invalid index or unavailable host: ""

MacOS: 11.1

~ ❯ fish --version
fish, version 3.1.2

~ ❯ fisher --version
fisher, version 4.1.0

~ ❯ nvm --version
nvm, version 2.0.1

.nvmrc content: v12.20.0

@jorgebucaran
Copy link
Owner

@lkonya It appears that $nvm_mirror was not correctly set. Did you happen to set nvm_mirror to an empty string (inadvertently or not) for some reason?

What does this tell you?

$ la ~/.local/share/
$ echo $nvm_data
$ echo $nvm_mirror

I expect $nvm_mirror to be empty for you. If it isn't, run this:

command curl --location --silent $nvm_mirror/index.tab | command awk -v OFS=\t '
    /v0.9.12/ { exit } # Unsupported
    NR > 1 {
        print $1 (NR == 2  ? " latest" : $10 != "-" ? " lts/" tolower($10) : "")
    }
'

@jorgebucaran jorgebucaran changed the title nvm install is borken Invalid index or unavailable host Jan 5, 2021
@lkonya
Copy link
Author

lkonya commented Jan 7, 2021

@jorgebucaran I have no idea what changed, but it now works. Sorry for the false alarm. Thank you for your help!

If you encountered with this problem multiply time, maybe it could be mentioned in a FAQ?

@lkonya lkonya closed this as completed Jan 7, 2021
@jorgebucaran
Copy link
Owner

This could happen if the user set nvm_mirror to an empty string. We now initialize nvm_mirror regardless, so the problem is less likely to reoccur.

Repository owner locked as resolved and limited conversation to collaborators Jan 7, 2021
jorgebucaran added a commit that referenced this issue Feb 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants