jorgebucaran / nvm.fish

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

getting error on line 225 in nvm.fish using fish shell v3.4 & 3.6 #206

Closed EdmundsEcho closed 1 year ago

EdmundsEcho commented 1 year ago

This may well be something wrong at my end. Notwithstanding, I've been using this plugin for a bit. A little while ago, I started to have to manually install node using nvm with each new session. I put the following in my fish config. It seems to work in a non-tmux context. When using tmux I get the following error. Also, despite how I understand the last line in the message, node is not available to the terminal session.

fish: Unknown command: node
~/.config/fish/functions/nvm.fish (line 225):
    command node --eval "
        console.log(process.version)
        console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version)
        console.log(process.execPath.replace(require('os').homedir(), '~'))
    "
    ^
in function '_nvm_node_info'
        called on line 1 of file ~/.config/fish/functions/nvm.fish
in command substitution
        called on line 135 of file ~/.config/fish/functions/nvm.fish
in function 'nvm' with arguments 'install lts'
Now using Node  (npm )

Here is my fish config entry:

# call nvm when node is missing
if not command -v node > /dev/null
  if command -v nvm > /dev/null
    nvm install lts
  else
    echo "NVM not found. Please install NVM and try again."
  end
end

I updated the plugins.

EdmundsEcho commented 1 year ago

update

The error occurs when I create a second pane in a tmux session.

EdmundsEcho commented 1 year ago

... per the update, the error seems to be isolated to when I open more than one pane in a tmux session.

jorgebucaran commented 1 year ago

Hey @EdmundsEcho! Is this issue still happening? While I could hide the error message by checking for Node availability, that would kind of defeat the purpose of using nvm in the first place, right? To me, it looks like more of a Fish or Tmux problem than an issue with nvm. So for now, I'm going to close here. But let's keep an eye on it, and if it turns out to be our problem, we can reopen it later. 😉