Skip to content
the poor coder

uninstall node js from mac

Poor Man
Published
Reading time
1 min read
On this page

How to Uninstall Node.js from a Mac#

If you are a developer and have been working with Node.js for a while, you may need to uninstall it for some reason. In this article, I will explain how to uninstall Node.js from a Mac in a few simple steps.

Step 1: Check the Version of Node.js Installed#

The first step before uninstalling Node.js is to check which version of Node.js is currently installed on your Mac. To do this, open the terminal and run the following command:

Bash
$ node -v

This will display the current version of Node.js installed on your Mac.

Step 2: Uninstall Node.js using Terminal#

The easiest way to uninstall Node.js from a Mac is by using the terminal. Open the terminal and run the following command:

Bash
$ sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}

This command will remove all the files associated with Node.js from your Mac. Note that, you need to have administrative privileges to execute this command.

Step 3: Verify if Node.js is Uninstalled#

After running the above command, Node.js should be uninstalled from your Mac. To verify if it is uninstalled, open the terminal and run the following command:

Bash
$ node -v

If Node.js is uninstalled properly, you should see an error message saying "command not found".

Alternative Way#

If you have installed Node.js using a package manager like Homebrew or MacPorts, you can uninstall it using those package managers. For example, if you have installed Node.js using Homebrew, you can run the following command to uninstall it:

Bash
$ brew uninstall node

This command will remove Node.js and its dependencies installed by Homebrew.

Conclusion#

Uninstalling Node.js from a Mac is a simple process that can be done in a few steps. If you encounter any issues while uninstalling Node.js, feel free to leave a comment below.

Keep going

2023

how to sort an array

How to Sort an Array If you have an array and you want to order its elements in a specific way, you need to use a sorting algorithm. There are several sorting algorithms available, but two of the most commonly used are…

javascript2 min read
2023

jquery mobile or desktop

jQuery Mobile or Desktop? As a web developer, I have had some experience with both jQuery Mobile and jQuery Desktop. Both frameworks have their pros and cons, and which one to use really depends on the specific project…

javascript1 min read
2023

node.js folder structure

Node.js Folder Structure If you are new to Node.js, it can be daunting to create a folder structure that will work for your project. The structure you choose will depend on the size and complexity of your project. Here…

javascript1 min read
ESC