nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
79.05k stars 7.92k forks source link

Add `nvm rm` as an alias for `nvm uninstall` #3236

Open bbrk24 opened 10 months ago

bbrk24 commented 10 months ago

Here's an excerpt from my bash history:

nvm i v20.10
nvm rm v20.9.0
nvm uninstall v20.9.0

npm rm is a synonym for npm uninstall, so naturally I try the same thing for nvm. Every single time, it barfs out a help string and I have to re-run the command with the full name. It would be more convenient if that alias existed.

ljharb commented 10 months ago

It'd be easy to add, but I'm not sure a destructive action is something that should be more convenient.

bbrk24 commented 10 months ago

Updating a minor version within the same major version is a common action for me (I like to keep up to date with my node installs), so maybe this is a bit of an XY problem. Perhaps instead there should be a command for "replace 20.9 with 20.10".

ljharb commented 10 months ago

Yeah, that's a bit more motivated an ask - I do that too (for patch versions; i keep every node minor on my machine forever). Currently i run nvm install X --reinstall-packages-from=X and then i manually nvm uninstall $previousX. Perhaps something like nvm migrate X Y, or something else?

bbrk24 commented 10 months ago

Yeah, nvm migrate could work. I'd also expect that to update aliases as well.