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

weird error #139

Closed orefalo closed 3 years ago

orefalo commented 3 years ago
~/.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 32 of file ~/.config/fish/functions/nvm.fish
in function 'nvm' with arguments 'install lts'
    called on line 113 of file ~/.config/fish/conf.d/masterconfig.fish
from sourcing file ~/.config/fish/conf.d/masterconfig.fish
    called on line 294 of file /usr/local/Cellar/fish/3.1.2/share/fish/config.fish
from sourcing file /usr/local/Cellar/fish/3.1.2/share/fish/config.fish
    called during startup
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory
nvm: Invalid index or unavailable host: ""
nvm: Node version not installed or invalid: "lts"

I am getting the follow error -

orefalo commented 3 years ago

works fine from the command line -

fails during init..

jorgebucaran commented 3 years ago

How did you install this plugin? What did you run exactly? Fish version. Fisher version.

What do you mean by "fails during init.."?

Can you also show what's in your config.fish?

orefalo commented 3 years ago

This is what I get when I instantiate a new session, I must point that it works perfectly fine thereafter.

Last login: Wed Feb 17 22:28:19 on ttys000

~/.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 32 of file ~/.config/fish/functions/nvm.fish
in function 'nvm' with arguments 'install lts'
    called on line 113 of file ~/.config/fish/conf.d/masterconfig.fish
from sourcing file ~/.config/fish/conf.d/masterconfig.fish
    called on line 294 of file /usr/local/Cellar/fish/3.1.2/share/fish/config.fish
from sourcing file /usr/local/Cellar/fish/3.1.2/share/fish/config.fish
    called during startup
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory
nvm: Invalid index or unavailable host: ""
nvm: Node version not installed or invalid: "v14"
Welcome to fish, the friendly interactive shell
Type `help` for instructions on how to use fish

~
❯ fish -v
fish, version 3.1.2

I installed it with fisher install jorgebucaran/nvm.fish

my

    if test (type -t nvm) = "function"
        nvm install lts
        nvm use v14
    end
orefalo commented 3 years ago

ok I found the issue, it has nothing to do with your plugin.

in .config, the script that runs this

  if test (type -t nvm) = "function"
        nvm install lts
        nvm use v14
    end

is evaluated prior to nvm.fish

pageza commented 3 years ago

@orefalo How did you resolve this? I am running into an issue where it runs fine in my Alacritty shell, but when I try using nvm in my Webstorm IDE terminal I get a similar error:

~/.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 33 of file ~/.config/fish/functions/nvm.fish
in function 'nvm' with arguments 'install lts'
nvm: Invalid index or unavailable host: ""

I'm not sure what the issue was, but on a lark I ran the fisher install for this and it works in Webstorm now. I apologize for bumping a non-issue.

orefalo commented 3 years ago

hum, if i recall... update to the latest version(s) uninstall / reinstall

I don't have the issue anymore..

orefalo commented 3 years ago

Actually reading the thread again.. my comment on Feb 18 seems to be the solution