Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall complete NVM in macOS

Tags:

node.js

nvm

I have already installed Node.js v16 and Node Version Manager (NVM) on my mac. It's caused some conflict when try to run node.js application. I would like to uninstall NVM and remove all installed Node.js versions. How do i completely remove it?

like image 328
omers Avatar asked Sep 13 '25 12:09

omers


1 Answers

You can remove $NVM_DIR which is usually ~/.nvm.

rm -rf $NVM_DIR

There will also be a snippet in your terminal profile file (i.e. .zshrc, .bashrc) which you can remove. The snippet safely loads NVM, so if it's not installed then nothing will happen.

It'll look something like

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Afterwards you will need to restart your terminal to not have a lingering node alias.

like image 115
Joey Ciechanowicz Avatar answered Sep 17 '25 20:09

Joey Ciechanowicz