Here’s how to uninstall Node on your Mac
If you’ve installed Node.js on your Mac to learn how it works and experiment using it on a server you run but no longer want it, you should uninstall it. Uninstalling software you don’t use is good practice, as it frees up space and reduces the possibility of its files causing conflicts with other software on your Mac. In this article, I’ll show you how to uninstall Node.js.
What is Node.js?
First, let’s take a closer look at what Node.js is and what it does, just in case you found it lurking on your Mac and do not recall installing it in the first place.
Why uninstall Node.js?
As I said, it’s a good practice to uninstall any software you no longer use. Why? Because it takes up space and can cause conflicts, especially when it’s not updated to the latest available version.
Now, it’s important to point out that it’s not enough to simply drag the application binary — the file that sits in your Applications folder — into the Trash and then empty it. That leaves lots of files (or leftovers) scattered around the startup disk and could cause problems in the future.
The good news is that if you have already trashed the application binary without uninstalling it properly, you can still remove the leftovers pretty easily. Let me show you how it’s done.
How to uninstall Node.js on your Mac
There are several ways to uninstall Node from your Mac. The best one for you to use depends on how you installed it in the first place. Choose the options that best fit your situation below.
How to uninstall Node.js if you installed it using Homebrew
If you installed Node using Homebrew, go to Applications > Utilities and launch Terminal, then type the following command:
brew uninstall --force node
That will uninstall Node and all of its components.
How to uninstall Node.js if you installed it with Node Version Manager (NVM)
If you used NVM to install Node, launch Terminal and type the following command:
nvm uninstall <version> </version>
nvm uninstall v17.0
How to uninstall Node.js manually
This one is the most challenging way to uninstall Node, as you will have to track down lots of different files and remove them manually one by one.
- Click on the Finder icon in the Dock, choose the Go menu, and then Go to Folder.
- Paste the following directory path in the text box: /usr/local/lib
- Look for files with the name ‘node’ and move them to the Trash.
- Repeat these three steps for the following directories, pasting each path into the text box in Go to Folder and dragging the files with ‘node’ to the Trash.
- Go to your Home folder and drag the files below to the Trash: .npm; .node-gyp; .nodereplhistory.
- Empty the Trash.
How to uninstall any app easily
As you can see, there are a lot of steps involved in completely uninstalling Node.js. The same is true for most applications. If you want to uninstall them manually and thoroughly, you will need to hunt down every file and drag it to the Trash.
However, there is a more effortless way, thanks to a handy application called CleanMyMac X. Among many other valuable tools, CleanMyMac X has an Uninstaller module that takes all the work out of uninstalling apps. You can download it for free here.
Once you’ve downloaded it, follow the steps below to uninstall an application.
- Launch CleanMyMac X and choose Uninstaller.
- Locate the application you want to uninstall (tip: you can filter applications by clicking the name of the developer in the middle pane or find them through the search bar).
- Check the button next to the application’s name.
- Click Uninstall.
How to remove application leftovers
Remember we mentioned earlier that if you have moved an application binary to the Trash, you still need to remove leftovers? Well, you can do that using CleanMyMac X, too.
- Choose the Uninstaller module.
- In the middle pane, select Leftovers (the number next to it tells you how many leftover files CleanMyMac X has found).
- Check the button next to the leftovers you want to remove in the right pane.
- Click Uninstall.
Once the removal is complete, you can rest assured that all app traces are gone from your Mac for good. The app frees up precious space and eliminates the possibility of those files causing a problem in the future.