Home >System Tutorial >MAC >How to Uninstall Node.js on Mac? How to Remove It?
Removing Node.js from your Mac: A Comprehensive Guide
Need to uninstall Node.js from your Mac to free up space or switch to a different development environment? This guide provides multiple methods, catering to different installation approaches. Node.js, a popular JavaScript runtime environment, is excellent for building scalable applications, but its removal can be tricky if you're unsure how it was installed.
Several methods exist for uninstalling Node.js, depending on your installation method: manual removal, Homebrew, Node Version Manager (NVM), or Terminal commands.
Manual Removal (Most Tedious):
This method requires meticulous attention to detail, as you'll manually delete individual files and folders.
/usr/local/lib
and click "Go"./usr/local/bin
, /opt/local/bin/
, /opt/local/lib/
, /usr/local/lib/dtrace/
, /opt/local/include/
, /usr/local/include
, /usr/local/share/doc/
, /usr/local/share/man/man1/
, /usr/local/share/systemtap/tapset/
.Homebrew Removal (Easiest):
If you used Homebrew, uninstalling is straightforward:
brew uninstall --force node
NVM Removal (Simple):
Node Version Manager (NVM) simplifies the process.
nvm uninstall [version]
(replace [version]
with your Node.js version, e.g., nvm uninstall v18.16.0
).Determining Your Node.js Version:
node -v
to display the installed version.Terminal Command Removal:
This method uses Terminal commands for a complete uninstall.
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
rm -rf ~/.npm
Conclusion:
Uninstalling Node.js can be complex. This guide offers various methods to suit different installation scenarios. For a thorough cleanup, consider using a dedicated uninstaller tool like MacKeeper's Smart Uninstaller to ensure all leftover files are removed. This will prevent potential conflicts and keep your system clean.
The above is the detailed content of How to Uninstall Node.js on Mac? How to Remove It?. For more information, please follow other related articles on the PHP Chinese website!