How to uninstall Node.js on a Mac

7 min read

Need a fresh start without Node.js? Or maybe you’ve been experiencing issues and need to uninstall and install it again. Maybe you’ve even already tried to uninstall Node.js on Mac and haven’t been able to do so. If any of these situations have you nodding your head, then this article is for you.

We’ll be going over how to uninstall Node on Mac in numerous different ways so you can find the proper solution for you.

What is Node.js?

Once upon a time, JavaScript could only be run in a browser. With Node.js, developers can run JavaScript outside of them. Node.js is an open environment that lets you run JavaScript on your own Mac and achieve its full potential. 

Meanwhile, JavaScript is a programming language that deals with all the interactive aspects of a website. To give life to web pages, JavaScript uses animated elements like graphics and slideshows. With platforms like Node.js, it can expand past traditional borders and can be used for more advanced and versatile purposes like game development. They work perfectly in harmony to provide web developers with the ideal space to harness JavaScript’s in all its glory.

The best part about Node.js is that it’s able to work across platforms, which means it can run on just about any operating system you can think of – macOS, Windows, Linux, and more. It has a leg up over other programming languages and environments that are only limited to certain systems. As developers don’t have to write out code again and again, it saves them time and effort, and it’ll run smoothly regardless of the user’s operating system.

Because of Node.js, there’s a lot more consistency in the web development process as it also lets developers use the same language (in this case, JavaScript) for a dual purpose. One language can be used for both the front end (all the stuff the user sees) and the back end (all the stuff that happens behind the scenes to make the front end function properly).

How to uninstall Node.js on a Mac

The versatility doesn’t end there, as there are many ways to uninstall Node on macOS. So, if one method hasn’t worked for you, know that there are a couple of others that could do just the trick. We’ll go through how to use Homebrew to uninstall Node, as well as Mac Terminal, Node Version Manager, and CleanMyMac as alternatives.

How to uninstall Node.js via Mac Finder

Uninstalling Node using the Mac Finder is one of the easier ways to get the job done, as it doesn’t require an extensive knowledge of Terminal commands. Here’s how to do it:

  1. Click on the Finder icon in your Mac’s dock.
  2. Click on Go in the menu bar and select Go to Folder.
  3. Enter the directory path /usr/local/lib in the text box.

directory path for node modules

  1. Delete all the files associated with Node and empty your trash can.

node modules folder

To make the process easier, Path Finder can view and edit any hidden files that Finder might not reveal. A lot of the time, uninstallment issues happen because of hidden or lagging files and folders that remain on your Mac and don’t get deleted along with the main program. 

Path Finder acts as an advanced file manager, letting you get a complete view of the contents of your Mac. You can take advantage of its dual-pane layout, where you can move and organize files between different locations without needing to use multiple Finder windows. It also offers a quick-search feature – a handy-dandy feature to help locate anything instantly.

path finder interface

In a situation where you need to look through files and folders, all you have to do is scroll over your Downloads folder, Documents folder, and just about everything in between, and Path Finder will give you a full, transparent overview of what exactly is inside them. With this app, time-consuming searches are over – you won’t have to go through those lengthy processes each time you need to find what you're looking for.  

Uninstall any app on Mac with ease

Another useful app to handle uninstallment processes and more is CleanMyMac – a comprehensive tool that can clean, optimize, and protect your Mac. One of its primary features is being able to fully uninstall and remove apps from your hard drive. It leaves no traces behind and helps you bypass the difficulties that Mac uninstallation typically brings. There is a whole suite of other useful actions like cleaning up system junk, tools for optimization, and malware removal features in case of security threats.

When you’re ready to uninstall an app for good, all you need to do is:

  1. Click on Uninstaller under Applications.
  2. Select all the applications that you want to uninstall from your Mac.
  3. Click Uninstall.

Clean my mac uninstaller

How to remove Node.js using Homebrew

If you’ve installed Node.js using Homebrew, installation involves the Mac Terminal.

terminal in mac applications folder

  1. Type in the command brew uninstall --force node.

terminal brew uninstall command

Node.js, as well as all its related components, will be uninstalled.

How to delete Node.js with Node Version Manager (NVM)

If you installed Node.js with Node Version Manager, then the installation process will look even more different, but it also begins by accessing Terminal.

Open the Terminal and type in the command nvm uninstall and replace “version” with the actual version number of Node.js you have downloaded. For example, if you have v20.12.2 downloaded, then you’d type in nvm uninstall

nvm uninstall terminal

In some cases, you may need to type in your admin password to give permissions. If so, enter it, and Node.js will be uninstalled from your Mac. 

How to uninstall Node.js with Mac Terminal

If you installed Node the traditional way and not with Node Version Manager or Homebrew, you can still use Mac Terminal to uninstall it. 

  1. Open Terminal, type in cd /usr/local/include/, and press enter to go to the Node directory.

node directory terminal

  1. Type in the command sudo rm -rf node and click enter to delete the main Node folder. You’ll likely have to enter your password to give permissions.
  2. Go to the next directory by typing in the command cd /usr/local/lib and pressing enter.
  3. Delete the node_modules folder by typing in sudo rm -rf node_modules and pressing enter.
  4. Go to the next directory by typing in cd /usr/local/bin and pressing enter.
  5. Delete all other associated folders by typing in sudo rm -rf node npm npx and pressing enter.

node modules deletion command terminal

This process should completely delete Node.js.

Want to elevate your Terminal experience? Core Shell is the perfect full-featured SSH terminal that boasts advanced features such as tag organization for hosts, tons of customization options, OpenSSH support, and even integration with macOS Keychain.

core shell interface

With Core Shell, you can create a more efficient and easy-to-use Terminal experience that’ll help you simplify commands and take advantage of secure SSH support. It also gives you a much more attractive and pleasant environment with a variety of customizable fonts, themes, and colors.

Choosing the best way to uninstall Node on Mac

Node.js is clearly a revolutionary tool in web development, but there may be a situation that’ll require you to uninstall Node on Mac. Now you know how to uninstall Node on Mac in numerous ways, whether through Mac Finder or Terminal or making the process easier with a user-friendly third-party tool.

Macs don’t make it easy to uninstall apps from the system. The main app icon might be gone, but you’ll be left with files in your directory that you might not realize are there. If you want to be 100% sure that Node.js or any other app is fully uninstalled, third-party tools are the way to go.

All these practical apps – Path Finder, Core Shell, and CleanMyMac – as well as many more macOS native tools, can be found in Setapp, a platform with 240+ apps available through just one subscription. Through a 7-day trial, you can access all sorts of apps to stay focused, be more productive, reduce CPU usage, and make processes more efficient.

FAQ

Can I reinstall Node.js after uninstalling it?

Uninstalling Node.js doesn’t prevent you from installing it again. Many people who uninstall Node actually use it as a method for troubleshooting in cases where there are issues or errors in the system. It could also mean being able to download a more recent version of the program from the official Node.js website. All you have to do is download it from the website or choose Homebrew or Node Version Manager as your download method.

Will uninstalling Node.js remove NPM (Node Package Manager)?

If you want to uninstall NPM on Mac, going through the uninstallment process would remove NPM by proxy, as they’re bundled and installed at the same time. They come together as a package deal, as indicated by its name.

How can I check if Node.js is successfully uninstalled from my Mac?

Since Terminal can be unspecific when it comes to uninstallation, an easy way to make sure Node.js is successfully uninstalled is by entering one simple command. Start by opening Terminal, and go ahead and enter node-v as a command into the window. Press enter, and you’ll either see a version number returned or a message that says something like “Command not found”. If you see the “Command not found” message, you’ve successfully uninstalled Node. Otherwise, you still have the version number displayed and will need to start the reinstallment process over again. An even better way to make sure a Node uninstall on Mac was successful is to use CleanMyMac, as it has a dedicated uninstaller feature to give you peace of mind.

250+ apps for $9.99
per month

Sign up to Setapp and try them for free.

Security-tested