Home > Enterprise >  How to uninstall complete NVM in macOS
How to uninstall complete NVM in macOS

Time:09-29

I would like to uninstall NVM from my mac. Also I want to remove all installed Node.js versions. How do i completely remove it?

CodePudding user response:

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.

  • Related