drmrbrewer
drmrbrewer

Reputation: 12989

nvm uninstall doesn't actually uninstall the node version

So I'm trying to clear out older versions of node.js.

I start with:

$ nvm ls
      v0.10.30
      v4.2.3
->    v6.6.0
      system

I don't want the older versions, so I then do:

$ nvm uninstall 4.2.3
Uninstalled node v4.2.3

I then verify that it's done what I wanted, but it gives the same list of installed versions as before:

$ nvm ls
      v0.10.30
      v4.2.3
->    v6.6.0
      system

Specifically, v4.2.3 is still there.

Any ideas what I might be doing wrong? Any other way to force the uninstall? I'm using the Cloud 9 IDE.

Upvotes: 122

Views: 280875

Answers (9)

Raj
Raj

Reputation: 1284

if you need to uninstall the current active version deactivate it and then uninstall it

nvm deactivate
nvm uninstall v20.14.0

Upvotes: 5

Flavio Lima
Flavio Lima

Reputation: 337

cd ~/.nvm/versions/node
rm -Rf v4.2.3

Try clearing your cache

nvm cache clear

Upvotes: 21

Alfred
Alfred

Reputation: 1

example1. bash shell.

nvm uninstall  19.*

example2. bash shell.

for i in {1..30}; do echo $i; nvm uninstall  $i.*; done

Upvotes: -2

Santosh
Santosh

Reputation: 2323

Rather than running uninstall and deleting the directory from nvm, do the other way around.

  • Navigate to the nvm directory
cd ~/.nvm/versions/node
  • Run nvm install
nvm uninstall <version>
nvm uninstall v16.7.0

This will automatically uninstall the specific node version and also delete the folder.

Upvotes: 3

Ali Sher Khan
Ali Sher Khan

Reputation: 41

I just deleted my node version using:

nvm uninstall v12.22.12

Upvotes: 2

MADHUR GUPTA
MADHUR GUPTA

Reputation: 1483

Remove by command

nvm uninstall <version> 
nvm uninstall v16.7.0

remove manually

cd ~/.nvm/versions/node
sudo rm -rf v16.7.0/

Upvotes: 89

Tino Jose Thannippara
Tino Jose Thannippara

Reputation: 752

nvm deactivate then nvm uninstall 4.2.3 or (version number)

it will work.

Upvotes: 15

silvanasono
silvanasono

Reputation: 394

It works now, in nvm version 0.35.1. Or at least it worked for me.

If the node version we want to uninstall is the currently used one though, before uninstalling it we need to nvm use another version.

Upvotes: 7

sudo
sudo

Reputation: 1801

removing manually:

cd ~/.nvm/versions/node
sudo rm -rf v4.2.3/

Upvotes: 145

Related Questions