nvm icon indicating copy to clipboard operation
nvm copied to clipboard

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

Open bbrk24 opened this issue 2 years ago • 4 comments

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.

bbrk24 avatar Nov 23 '23 03:11 bbrk24

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

ljharb avatar Nov 23 '23 03:11 ljharb

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".

bbrk24 avatar Nov 23 '23 03:11 bbrk24

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?

ljharb avatar Nov 23 '23 03:11 ljharb

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

bbrk24 avatar Nov 23 '23 03:11 bbrk24