Open In App

Uninstall Node.JS Using Linux Command Line

Last Updated : 17 Oct, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

To uninstall Node.js from your Linux system, you can use the command line, and the process will vary depending on how you originally installed it. Whether you used a package manager like apt, installed Node.js using nvm (Node Version Manager), or manually installed it from a binary file, you can easily remove Node.js from your system by following the appropriate method.

This article will guide you through several ways to uninstall Node.js, ensuring that it is completely removed from your system.

Checking the Installation Method

To determine the correct uninstallation method, you first need to know how Node.js was installed. The most common installation methods include:

  • Package managers such as apt (for Ubuntu/Debian) or yum (for CentOS/RedHat).
  • nvm (Node Version Manager) for managing multiple versions of Node.js.
  • Manual installation from binary files.

To check if Node.js is installed, run:

node -v
uninstall-node
Checking the Installation Method

If you're using nvm, you can check for installed Node.js versions with:

nvm ls

Steps to Uninstall Node Using Linux Package Managers

Step 1: Enter the following command to remove node

sudo apt remove nodejs
command to remove node

This will uninstall nodejs from the system.

Step 2: Enter the following command to remove npm

sudo apt remove npm
command to remove npm

This will uninstall npm from the system

Step 3: Enter the following command to remove any used files

sudo apt autoremove
command to remove any used files

Step 4: Enter the command to check if Node.js is present in the system or not.

node -v
check if Node.js is present in the system or not

Next Article

Similar Reads