The way to install node.js on a Mac is different than the regular method for installing applications on the system. Therefore, when it comes to uninstalling it, most users are confused. That’s why we’ve prepared a guide explaining how to uninstall Node on a Mac.
Contents:
- What is Node.js?
- Where is Node installed on your Mac?
- How to check what version of Node you have
- How to uninstall Node.js from a Mac
- How to remove applications’ leftovers from a Mac
- FAQs
Before we start
You can find those leftover files manually; however, you can also use a special utility called App Cleaner & Uninstaller from Nektony, which automatically finds all the service files each app has left on your Mac and helps you uninstall the programs completely.
App Cleaner & Uninstaller
Video Guide: Deleting Node on a Mac
What is Node.js?
Node.js is a tool that helps computers run JavaScript outside of a web browser. With Node.js, developers can use JavaScript just like other programming languages, for example, to build apps, create servers, and manage data.
To understand, think of it like this:
If JavaScript is a car that usually drives on highways (web browsers), Node.js is a special upgrade that lets it drive off-road (on computers and servers).
The way to remove Node.js depends on the way you used to install it on your Mac. Below we’ll provide step-by-step guides for each way.
Where is Node installed on your Mac?
To uncover where Node.js is installed on a Mac, first, you should try to remember how you installed it. Depending on that, the software’s files can be stored in different locations on your Mac.
If you downloaded the installer file from the official website, you should look for the software support files in the following locations:
- /usr/local/bin
- /usr/local/lib
- /usr/local/include
- /usr/local/lib/dtrace
- /usr/local/share/doc
- /usr/local/share/man/man1
- /usr/local/systemtap/tapset
How to check what version of Node you have
You will need the Terminal command line to check the version of Node you have on your Mac. Follow these steps:
- Open the Terminal from Launchpad or the Applications folder.
- Copy and paste the following commands into the Terminal window:
- node -v
- npm -v
- You will then see which Node version is installed on your system.
How to uninstall Node.js from a Mac
The steps for uninstalling Node on your Mac again depend on how you installed it. You can remove it using the Terminal command line or manually find and remove its files from your Mac.
How to uninstall Node that was installed using Homebrew
- Open Terminal from Launchpad or the Applications folder.
- Type the following command in its window and press Return:
brew uninstall –force node - The system will remove the software and all of its support files.
How to uninstall Node installed using NVM
NVM is an abbreviation of Node Package Manager. If you installed the app with NVM follow these steps to remove the app:
- Launch Terminal.
- Type the following command and press Return.
nvm uninstall v.16.15.0
Note: You need to type the Node version number used on your Mac. Above, you can find the guide on how to check the version.
How to uninstall Node from Finder
For this method, you will need to manually find and remove all files associated with Node. Here is how:
- Open Finder.
- Press the Cmd+Shift+G shortcut.
- In the search field, type /usr/local/lib and press Return.
- Find the files or folder with Node in their names and move them into the Trash.
- Go also to the locations listed below and remove all node and node_modules from there:
- /usr/local/include/node
- /usr/local/include/node_modules
- /usr/local/lib/node
- /usr/local/lib/node_modules
- /usr/local/bin/node
- /usr/local/bin/node_modules
- /usr/local/bin/node-gyp
- /usr/local/share/man/man1/npm
- /usr/local/lib/dtrace/node.d
- /opt/local/bin/ node
- /opt/local/include/node
- /opt/local/lib/node_modules
- /usr/local/share/doc/node
- /usr/local/share/systemtap/tapset/node.stp
- Remove the following files from the Home directory:
- .npmrc
- .npm
- .node-gyp
- .node_repl_history
- Once you remove all of Node’s files, empty your Trash.
- Restart your Mac.
Note that the app may have more or less support files depending on the version you have.
Node.js will be completely uninstalled from your Mac.
How to remove applications’ leftovers from a Mac
Just like Node, every application creates support files to ensure its proper performance. To completely uninstall any application from a Mac, you also have to remove all of its temporary files. By default, they should be stored in the Library folder. However, apps sometimes spread their files all over your disk.
To easily find support files left after dragging apps into the Trash use App Cleaner & Uninstaller. It is a software that helps you uninstall applications from your Mac completely and safely with a few clicks, as well as find the leftovers of previously deleted apps:
- Launch App Cleaner & Uninstaller.
- Click Remaining Files in its sidebar.
- Select leftover files in the left panel.
- Click the Remove button.
- Click again Remove to confirm.
Uninstalling Node.js from a Mac involves a different process than the steps for removing sandboxed apps. This article provided a detailed guide to do this. If you still have questions, let us know in the comments section below.
FAQs
How to check if Node.js is entirely uninstalled from a Mac?
Use the Terminal command line for this:
- Open Terminal.
- Type this command and press Return.
- If you see the “Command not found” message, Node.js is removed from your Mac.
node-v
Should I use NPM or NVM to install Node.js?
Both methods (NPM and NVM) allow installing Node on a Mac; however, the choice depends on the purposes of the use.
- Use NVM if you need to manage multiple Node.js versions, for example, if you are a developer who works on different projects requiring different software versions.
- Use NPM if you only need one version of Node.js (Best for general use or beginners)
Does uninstalling Node.js remove NPM?
When you uninstall Node.js, NPM should be removed automatically because they are both installed together. However, if you manually installed the app using a package manager (e.g., Homebrew or the official installer), it’s good to check if any NPM files remain.