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

How do I disable a Node version? #182

Closed p3k closed 2 years ago

p3k commented 2 years ago

I do not have a system-wide Node version installed. If I activate a version with nvm.fish, how could I deactivate it again – preferably without closing my terminal window?

❯ nvm ls
   v16.13.1 lts/gallium 

❯ nvm current

❯ nvm use lts/gallium 
Now using Node v16.13.1 (npm 8.1.2) ~/.local/share/nvm/v16.13.1/bin/node

❯ nvm current
v16.13.1

❯ 🤔
jorgebucaran commented 2 years ago

There is no dedicated command for that operation at this time. I don't have a system-wide Node either, and I've never run into a situation where I needed to go back to no node in the same tab. I just open a new tab.

Having said that, you could (1) uninstall that version:

nvm uninstall v16.13.1

(2) switch to a different node version that you've already installed:

nvm use latest

or (3) use the internal: _nvm_version_deactivate function:

_nvm_version_deactivate v16.13.1
p3k commented 2 years ago
_nvm_version_deactivate v16.13.1`

thanks for this great hint @jorgebucaran.

it can be simplified (and then aliased) to

_nvm_version_deactivate (nvm current)

splendid!