jorgebucaran / nvm.fish

The Node.js version manager you'll adore, crafted just for Fish
https://git.io/nvm.fish
MIT License
2.08k stars 69 forks source link

Invalid redirection target #141

Closed orefalo closed 3 years ago

orefalo commented 3 years ago

really having trouble with nvm.fish

it's not during boot anymore,

the behavior is inconsistent - sometimes it works, sometimes it doesn't and I can't figure what is the key driver

❯ nvm list-remote
~/.config/fish/functions/_nvm_index_update.fish (line 7): Invalid redirection target: 
    ' >$index.temp 2>/dev/null && command mv $index.temp $index && return
      ^
in function '_nvm_index_update'
        called on line 144 of file ~/.config/fish/functions/nvm.fish
in function 'nvm' with arguments 'list-remote'
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory
nvm: Invalid index or unavailable host: ""
❯ fish -v
fish, version 3.1.2
~/.config/fish took 12s
❯ ls --tree
 .
├──  completions
│  ├──  brew.fish
│  ├──  cprintf.fish
│  ├──  docker-compose.fish
│  ├──  fisher.fish
│  ├──  g.fish
│  ├──  kubectl.fish
│  └──  nvm.fish
├──  conf.d
│  ├──  autopair.fish
│  ├──  g2.fish
│  ├──  javahome.fish
│  ├──  nvm.fish
│  └──  zzzmasterconfig.fish
├──  functions
│  ├──  _autopair_backspace.fish
│  ├──  _autopair_insert_left.fish
│  ├──  _autopair_insert_right.fish
│  ├──  _autopair_insert_same.fish
│  ├──  _autopair_tab.fish
│  ├──  _grc_wrap.fish
│  ├──  _nvm_index_update.fish
│  ├──  _nvm_list.fish
│  ├──  _nvm_version_activate.fish
│  ├──  _nvm_version_deactivate.fish
│  ├──  cless.fish
│  ├──  cvs.fish
│  ├──  df.fish
│  ├──  diff.fish
│  ├──  dig.fish
│  ├──  fisher.fish
│  ├──  free.fish
│  ├──  g++.fish
│  ├──  gcc.fish
│  ├──  getopts.fish
│  ├──  ifconfig.fish
│  ├──  make.fish
│  ├──  man.fish
│  ├──  mount.fish
│  ├──  mtr.fish
│  ├──  netstat.fish
│  ├──  nvm.fish
│  ├──  ping.fish
│  ├──  ssh.fish
│  ├──  tail.fish
│  ├──  traceroute.fish
│  └──  wdiff.fish
├──  config.fish
├──  fish_plugins
└──  fish_variables
nvm list-remote
~/.config/fish/functions/_nvm_index_update.fish (line 7): Invalid redirection target:
    ' >$index.temp 2>/dev/null && command mv $index.temp $index && return
      ^
in function '_nvm_index_update'
    called on line 144 of file ~/.config/fish/functions/nvm.fish
in function 'nvm' with arguments 'list-remote'
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory
nvm: Invalid index or unavailable host: ""
jorgebucaran commented 3 years ago

Are you using the latest nvm.fish?

jorgebucaran commented 3 years ago

Ah, I see what's happening here. For now, just uninstall and reinstall to fix it. I'll find a way to make it work after updating. 👌

orefalo commented 3 years ago

The latest everything.

Indeed, reinstalling fixed it... hum, thanks!

jorgebucaran commented 3 years ago

The issue is that updating doesn't trigger an install event, which is where nvm_data and nvm_mirror are now set. We need to either set them inside update to allow for smooth updates or just do it right there in the snippet.

In any case, I'm glad you were able to get it working! 💯