How to Uninstall NVM?

Discover how to uninstall NVM (Node Version Manager) on Linux, macOS, and Windows with this comprehensive step-by-step guide.

Get Started free
How to Uninstall NVM
Home Guide How to Uninstall NVM?

How to Uninstall NVM?

The Node Version Manager (NVM) is a tool for managing different versions of Node.js on your local machine. It allows users to switch between versions based on the project they’re working on.

This flexibility is essential for developers, as it helps maintain compatibility and prevent conflicts across different Node environments, where changes in one version might cause issues in another.

However, there are times when you may want to uninstall NVM. Perhaps you’re switching to a different version manager, no longer need it, or are encountering issues that prompt a fresh setup. Whatever the reason, removing NVM can help simplify your development environment.

This article explores how to uninstall NVM across different operating systems, Linux, macOS, and Windows.

Checking if NVM is Installed

It is necessary to check if you have NVM installed on your machine before attempting to uninstall the tool.

To check if NVM is installed on your computer, open your terminal and type the following command:

nvm --version

The current version will be displayed on your terminal if the NVM is installed on your computer. An error message “command ‘nvm’ not found” will be shown in your terminal if NVM is not installed or the path has not been correctly set.

Uninstalling NVM on macOS/Linux

If you’re using macOS or Linux and need to uninstall NVM, the process is straightforward. Follow the steps below to remove it from your system and ensure a clean setup.

1. To uninstall NVM begin by removing the directory in the home directory with the following command:

rm -rf ~/.nvm

2. Remove NVM configuration lines from bash profile files such as ~/.bashrc, .~/.bash_profile, and ~/.profile.

Open the above-listed files with a text editor, find and remove these lines and save:

export NVM_DIR="$HOME/.nvm"

[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm

[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

3. Apply the changes made by reloading your shell profile file as follows:

source ~/.<your_shell_profile_file>

Close the current terminal and reopen a new terminal window. The NVM tool will have been completely uninstalled and removed from your macOS/Linux computer.

Uninstalling NVM on Windows

A different set of steps will be required to uninstall NVM on your Windows computer. The uninstallation can be done using Windows uninstaller or manual removal.

Using the Windows Uninstaller

Below are the steps required to remove NVM via the uninstaller.

  1. Select the Start Menu on the taskbar.
  2. Click on “Settings” on the Start Menu.
  3. Click on “Apps” in the popup window.
  4. Select “Apps & features” on the left sidebar.
  5. Scroll down or search for “NVM” among the listed apps.
  6. Click on it and select “Uninstall”.
  7. Click “Uninstall” again in the popup window.
  8. Follow the prompt to complete the uninstallation.

Manual Removal

To remove NVM manually, complete the steps below:

1. Navigate to the NVM directory, usually found in this location C:\Users\{YourUsername}\AppData\Roaming\nvm

2. Delete the NVM directory.

3. Remove NVM from the Environmental Variables.

    • Right-click on “My Computer”.
    • Select “Properties”.
    • Click on “Advanced system setting”.
    • Click on the button with “Environment Variables”.
    • Find and remove the variables NVM_HOME and NVM_SYMLINK in the “System variables.”
    • Edit the Path variable and remove any entries containing nvm.

Verifying NVM Removal

After completing the outlined steps on uninstalling NVM on macOS, Linux, and Windows you’ll have to verify it has been completely removed.

Verifying removal on macOS/Linux

To confirm NVM was removed, type the following command in your terminal:

nvm --version

You should get the error message “Command ‘nvm’ not found” displayed on your terminal. This means the uninstallation process was successful.

Verifying removal on Windows

For Windows, restart your computer so all the changes made take effect. After your computer boots to the home screen, open the command prompt and type the command:

nvm --version

After successful uninstallation, the command prompt will display the message “’npm’ is not recognized as an internal or external command.”

Now that your local environment is clean, consider using a cloud-based solution like BrowserStack to test your applications across real devices and browsers.

BrowserStack Live Banner

Conclusion

The Node Version Manager (NVM) is an essential tool for Node.js developers as it helps them manage various versions of the JavaScript runtime environment. Since different projects might have different versions of Node.js, NVM helps to maintain compatibility and minimize version conflicts.

However, NVM should not be confused with the Node Package Manager (NPM) used for managing JavaScript/Node packages and modules.

Whether you’re on macOS, Linux, or Windows, following the right steps ensures NVM is fully removed without leaving behind unnecessary files. By understanding the uninstallation process, you maintain better control over your system and can set up a development environment that best fits your current needs.

If you’re looking to test your applications across different environments without managing multiple local setups, consider using BrowserStack. It lets you run automated and manual tests on a real-device cloud with 3500+ real browser and device combinations, helping you catch environment-specific issues early and deliver more reliable software.

Try BrowserStack Now

Tags
Automation Testing Manual Testing Real Device Cloud Website Testing

Get answers on our Discord Community

Join our Discord community to connect with others! Get your questions answered and stay informed.

Join Discord Community
Discord