Here’s how to uninstall Node on your Mac
Having spent some years coding applications for macOS, we’ve created a tool that everybody can use. The all-round problem fixer for Mac.
So here’s a tip for you: Download CleanMyMac to quickly solve some of the issues mentioned in this article. But to help you do it all by yourself, we’ve gathered our best ideas and solutions below.
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.

Node.js is a server-side JavaScript runtime environment that executes JavaScript instructions on a server and delivers the results to the web browser client. It runs on macOS, Windows, Linux, and other platforms. Some well-known organizations, such as Netflix, Microsoft, LinkedIn, and Amazon AWS, use it to deliver their online services. It’s built on Google’s Chrome V8 JavaScript engine but is open source and can be downloaded by anyone.
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 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 Node.js if you installed it using Homebrew
If you installed Node using Homebrew, go to Applications > Utilities and open 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, open Terminal and type the following command:
Replace with the version number of Node.js you installed. So, for example, if you installed v17.0, you would type:
nvm uninstall v17.0
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.

- Open 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.
Node.js is a server-side JavaScript runtime environment that you may have installed on your Mac. If you no longer need it or use it, you should uninstall it to free up space and prevent it from conflicting with other software on your Mac. Follow the steps above to uninstall Node.js and use CleanMyMac X to remove any leftover files from Node or any other application.
How to completely remove node.js from Windows
I uninstalled my previous version of node.js (0.8.11) and downloaded the latest, 0.10.24 from the node.js website and installed it. However, after running node —version , it still indicates that I’m running v0.8.11. Obviously, some stuff was left behind during the uninstall process, and it’s causing me to have all sorts of errors when trying to add modules through npm. I’ve seen solutions to this for OSX and Linux, but couldn’t find anything for Windows. I’m running Windows 7 64-bit.
69.6k 33 33 gold badges 163 163 silver badges 221 221 bronze badges
asked Dec 20, 2013 at 20:12
Andrew De Forest Andrew De Forest
6,879 15 15 gold badges 39 39 silver badges 50 50 bronze badges
This sounds bad, but did you restart afterwards?
Dec 20, 2013 at 20:19
Find the uninstaller (e.g. WIN-key, Uninstall NodeJS). Worked for me.
Nov 9, 2020 at 15:09
9 Answers 9
How to remove Node.js from Windows:
- Take a deep breath.
- Run npm cache clean —force
- Uninstall from Programs & Features with the uninstaller.
- Reboot (or you probably can get away with killing all node-related processes from Task Manager).
- Look for these folders and remove them (and their contents) if any still exist. Depending on the version you installed, UAC settings, and CPU architecture, these may or may not exist:
- C:\Program Files (x86)\Nodejs
- C:\Program Files\Nodejs
- C:\Users\\AppData\Roaming\npm (or %appdata%\npm )
- C:\Users\\AppData\Roaming\npm-cache (or %appdata%\npm-cache )
- C:\Users\\.npmrc (and possibly check for that without the . prefix too)
- C:\Users\\AppData\Local\Temp\npm-*
- Check your %PATH% environment variable to ensure no references to Nodejs or npm exist.
- If it’s still not uninstalled, type where node at the command prompt and you’ll see where it resides — delete that (and probably the parent directory) too.
- Reboot, for good measure.
8,088 1 1 gold badge 48 48 silver badges 42 42 bronze badges
answered Dec 20, 2013 at 20:25
brandonscript brandonscript
69.6k 33 33 gold badges 163 163 silver badges 221 221 bronze badges
Ahh, it turns out I had Meteor installed which came packaged with it’s own node.exe. Thanks for your help!
Dec 20, 2013 at 21:11
I also had an %AppData%\npm-cache directory which was ~100 MB.
May 6, 2014 at 20:01
Make sure you also remove your %USERPROFILE%\.npmrc file! (usually C:\Users\my_username\.npmrc) If this has the wrong prefix= , literally nothing will work and it will leave you stumped seeing your fresh install just loop infinitely. See stackoverflow.com/questions/29388730/npm-hangs-on-any-command. @brandonscript, maybe add this to your answer as it is still a very popular google search result.
Aug 15, 2016 at 12:16
What about C:\Users\
Dec 12, 2016 at 8:45
You know an answer is good when Microsoft links to it in their documentation.
Jan 19, 2021 at 20:38
Scenario: Removing NodeJS when Windows has no Program Entry for your Node installation
I ran into a problem where my version of NodeJS (0.10.26) could NOT be uninstalled nor removed, because Programs & Features in Windows 7 (aka Add/Remove Programs) had no record of my having installed NodeJS. so there was no option to remove it short of manually deleting registry keys and files.
Command to verify your NodeJS version: node —version
I attempted to install the newest recommended version of NodeJS, but it failed at the end of the installation process and rolled back. Multiple versions of NodeJS also failed, and the installer likewise rolled them back as well. I could not upgrade NodeJS from the command line as I did not have SUDO installed.
SOLUTION: After spending several hours troubleshooting the problem, including upgrading NPM, I decided to reinstall the EXACT version of NodeJS on my system, over the top of the existing installation.
That solution worked, and it reinstalled NodeJS without any errors. Better yet, it also added an official entry in Add/Remove Programs dialogue.
Now that Windows was aware of the forgotten NodeJS installation, I was able to uninstall my existing version of NodeJS completely. I then successfully installed the newest recommended release of NodeJS for the Windows platform (version 4.4.5 as of this writing) without a roll-back initiating.
It took me a while to reach sucess, so I am posting this in case it helps anyone else with a similar issue.
Rukovodstvo
статьи и идеи для разработчиков программного обеспечения и веб-разработчиков.
Как удалить Node.js из Mac OSX
Если вы читали один из моих предыдущих постов о том, как установить Node.js [http://stackabuse.com/how-to-install-node-js-on-ubuntu/], вы, вероятно, заметили, что существует довольно много способов установите его на свой компьютер. Это может быть из диспетчера пакетов, из исходного кода или из предварительно скомпилированного двоичного дистрибутива. Итак, что вы делаете, когда хотите удалить Node.js? Здесь я опишу несколько способов удалить его с компьютера Mac OSX. Просто имейте в виду, что эти команды удаляют N
Время чтения: 3 мин.
Если вы читали один из моих предыдущих постов о том, как установить Node.js , вы, вероятно, заметили, что есть несколько способов установить его на свой компьютер. Это может быть из диспетчера пакетов, из исходного кода или из предварительно скомпилированного двоичного дистрибутива. Итак, что вы делаете, когда хотите удалить Node.js?
Здесь я опишу несколько способов удалить его с компьютера Mac OSX. Просто имейте в виду, что эти команды удаляют исполняемый файл Node, а не обязательно все проекты Node или кеш NPM.
Вручную
Если вы установили Node из исходного кода или из двоичного дистрибутива, вам, вероятно, придется удалить исполняемый файл и другие ресурсы вручную. К сожалению, это непросто, поскольку существует довольно много каталогов, содержащих ресурсы Node, например npm и node_modules .
Чтобы полностью удалить исполняемый файл node npm , вот несколько инструкций о том, что делать:
Обратите внимание, что не все каталоги, перечисленные здесь, могут существовать в вашей системе в зависимости от вашего метода установки.
- Удалите node и / или node_modules из /usr/local/lib
- Удалите node и / или node_modules из /usr/local/include
- Удалите node , node-debug и node-gyp из /usr/local/bin
- Удалите .npmrc из вашего домашнего каталога (это ваши настройки npm, не удаляйте их, если вы планируете сразу же переустановить Node)
- Удалите .npm из вашего домашнего каталога
- Удалите .node-gyp из вашего домашнего каталога
- Удалите .node_repl_history из вашего домашнего каталога
- Удалите node* из /usr/local/share/man/man1/
- Удалите npm* из /usr/local/share/man/man1/
- Удалите node.d из /usr/local/lib/dtrace/
- Удалить node из /opt/local/bin/
- Удалить node из /opt/local/include/
- Удалите node_modules из /opt/local/lib/
- Удалить node из /usr/local/share/doc/
- Удалите node.stp из /usr/local/share/systemtap/tapset/
Этот список должен включать почти все ссылки на Node в вашей системе. Имейте в виду, что их может быть больше. Пожалуйста, дайте мне знать, если вы найдете другие (и как вы изначально установили Node)!
Домашнее пиво
Метод Homebrew, возможно, является одним из самых простых способов включить и выключить Node в вашей системе. Команда для ее удаления так же проста, как и команда для ее установки. Предполагая, что вы использовали brew install node для его установки, просто выполните это, чтобы избавиться от него:
$ brew uninstall node
Вот и все! Все следы исполняемого файла исчезнут из вашей системы.
NVM
Диспетчер версий узлов (NVM) почти так же удобен, как Homebrew, но по-другому. Он позволяет вам установить несколько версий Node в вашей системе, чтобы вы могли легко переключаться с одной на другую.
В конце концов, вы, вероятно, захотите избавиться от одной из версий, когда закончите с ней. И, как и в случае с Homebrew, вы можете легко сделать это с помощью команды, аналогичной тому, как вы его установили:
$ nvm uninstall
И полный пример этого может быть примерно таким:
$ nvm uninstall v0.12.2
И теперь будет удалена только версия Node v0.12.2 . Имейте в виду, что если у вас было установлено несколько версий, то Node все равно будет в вашей системе, но не v0.12.2 (используя приведенный выше пример).
Фантомные установки
Если по какой-то причине ни один из вышеперечисленных методов у вас не сработал, вы всегда можете найти исполняемый файл с помощью инструмента командной строки, which . Эта команда показывает вам расположение файла для данной команды.
Мы можем использовать это, чтобы узнать, где в вашей системе установлен Node. Вы можете попробовать это с помощью:
$ which node /Users/scott/.nvm/versions/node/v4.1.2/bin/node
Вы можете видеть в выходных данных, что моя node связана с версией NVM, хотя ваша может находиться где-то еще. Теперь я могу использовать эту информацию, чтобы удалить его.
Использование этого инструмента должно помочь вам узнать, как был установлен исполняемый файл или как удалить его вручную.
Licensed under CC BY-NC-SA 4.0
Как удалить все каталоги node_modules
Как удалить все каталоги node_modules с компьютера.
Tools · 28.09.2021 · читать 1 мин · Автор: Alexey Myzgin
Как удалить все каталоги node_modules с компьютера
За последние несколько лет я запускал npm install больше раз, чем смогу сосчитать. И как результат на компьютере образовалось довольно много каталогов node_modules , о которых я давно уже забыл и не использую.
Зачастую проект мне больше не нужен, но бывает и так, что это кодовая база, с которой я всё же изредка работаю.
И вот на днях я решил удалить со своего компьютера все каталоги node_modules и выборочно переустановить те, которые мне могут понадобиться.
Работка могла бы быть действительно долгая и трудная, делай я всё вручную. Но, нашелся способ как сделать это при помощи всего лишь одного сценария командной строки.
Перед тем как удалить все каталоги node_modules, рекомендую протестировать скрипт и убедиться, что он не удалит то, что тебе нужно.
Во-первых, в окне терминала/интерфейса командной строки переходим в любой каталог, содержащий большую часть твоих проектов.
cd ~/ПУТЬ_К_ПАПКЕ
Затем запускаем этот код.
# Mac/Linux find . -name "node_modules" -type d -prune -print | xargs du -chs # Windows FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d"
После этого будет выведен список всех найденных node_modules и сколько дискового пространства они занимают (по отдельности и в целом).
Собственно удаление файлов
Если тебя устраивает то, что обнаруживает скрипт — можешь удалить все каталоги со своего компьютера.
ПРИМЕЧАНИЕ. Соблюдай осторожность и убедись, что ты находишься в каталоге, откуда ты удаляешь все экземпляры node_modules . Запусти приведенный выше сценарий, чтобы просмотреть их полный список перед удалением.
На самом деле этот скрипт очень похож на приведенный выше. Но, чтобы полностью всё удалить, мы будем использовать rm -rf .
# Mac/Linux find . -name 'node_modules' -type d -prune -print -exec rm -rf '<>' \; # Windows FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" rm -rf "%d"
- обязательно перечисли все node_modules в данном каталоге ПЕРЕД их удалением.
- будь осторожен, так как этот процесс необратим!
- не забудь снова установить npm для проектов, над которыми работаешь.
