70

I am doing this on OSX. I need to delete node. but after I type cmd: nvm uninstall v4.4.7 it prompts me that nvm: Cannot uninstall currently-active node version v4.4.7 How can I uninstall node completely?

1

2 Answers 2

178

just type following cmd:

$ nvm deactivate 

then type the uninstall cmd.

Sign up to request clarification or add additional context in comments.

2 Comments

Thx, that worked! Do I have to activate nvm after deactivating it?
@gignu , nvm deactivate does not remove nvm from PATH, but $NVM_DIR/*/bin , or say, the binary directory of installed node.js. About NVM_DIR. For me, which node outputs ~/.nvm/versions/node/v16.13.2/bin/node and nvm deactivate outputs ~/.nvm/*/bin removed from ${PATH} .
2

$ nvm deactivate is deprecated now.

For those who get the message Cannot uninstall currently linked node version - We have to unlink the default version before doing an uninstall

$ nvm unlink and then

$ nvm uninstall <version-number>

IMPORTANT: Edit on 30/Jan/2022: I am using a different version of nvm. Info

The above mentioned solution is applicable only for those who have installed @jchip/nvm.

6 Comments

nvm unlink is not a command on recent nvm version (0.39.1)
@Flip - Thanks for your comment. I was using nvm-windows and nvm version might not have been latest that time. See output of help command below. ``` >npm unlink -help npm uninstall [<@scope>/]<pkg>[@<version>]... [--save-prod|--save-dev|--save-optional] [--no-save] aliases: un, unlink, remove, rm, r ``` So how can you say this answer is not useful. You can add a comment against my answer, but not sure how you can downvote this. Also the question was posted in 2016, how is it relevant to latest version of nvm. The latest version might not even have the issue
1. your answer has now two different commands nvm unlink (still doesn't exist) and after edit npm unlink 2. how is situation of 2016 relevant in 2022? other answer did not get 118 upvotes because people are trying to recreate 2016 situation with unspecified nvm version of question starter. 3. "nvm deactivate is deprecated now" without any source of truth. We are now 1 year later, latest nvm version still has nvm deactivate and no word of "deprecated" 4. nvm deactivate and npm unlink are commands used for totally different purposes, read npm unlink --help and nvm --help
Ok i upvoted your answer based on different versions of nvm github.com/jchip/nvm and github.com/nvm-sh/nvm
Since when nvm deactivate is depricated? github.com/nvm-sh/nvm/blob/master/README.md?plain=1#L495
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.