1. Open the Terminal application.
2. Type the following command to uninstall Node.js:
sudo rm -rf /usr/local/bin/node
3. Type the following command to remove the npm configuration files:
sudo rm -rf /usr/local/lib/node_modules
4. Type the following command to remove the npm cache:
sudo rm -rf ~/.npm
5. Type the following command to remove the npm global configuration files:
sudo rm -rf /usr/local/etc/npmrc
6. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
7. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
8. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node
9. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/node*
10. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
11. Type the following command to remove the npm configuration files:
sudo rm -rf /usr/local/etc/npmrc
12. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
13. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
14. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
15. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
16. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
17. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
18. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
19. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
20. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
21. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
22. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
23. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
24. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
25. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
26. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
27. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
28. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
29. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
30. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
31. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
32. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
33. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
34. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
35. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
36. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
37. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
38. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
39. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
40. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
41. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
42. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
43. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
44. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
45. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
46. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
47. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
48. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
49. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
50. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
51. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
52. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
53. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
54. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
55. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
56. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
57. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
58. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
59. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
60. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
61. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
62. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
63. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
64. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
65. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
66. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
67. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
68. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
69. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
70. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
71. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
72. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
73. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
74. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
75. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
76. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
77. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
78. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
79. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
80. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
81. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
82. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
83. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
84. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
85. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
86. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
87. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
88. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
89. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
90. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
91. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
92. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
93. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
94. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
95. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
96. Type the following command to remove the npm executable:
sudo rm -rf /usr/local/bin/npm
97. Type the following command to remove the npm global directory:
sudo rm -rf /usr/local/lib/node_modules
98. Type the following command to remove the npm log files:
sudo rm -rf /usr/local/var/log/npm-debug.log
99. Type the following command to remove the npm configuration directory:
sudo rm -rf /usr/local/etc/npm
100. Type the following command to remove the npm man pages:
sudo rm -rf /usr/local/share/man/man1/npm*
If you’re a Mac user who no longer needs Node.js, you may be wondering how to uninstall it. Fortunately, there are several methods to remove Node.js from your Mac, depending on how you installed it. In this tutorial, you will learn how to uninstall Node.js on a Mac using terminal, homebrew and node version.
How to Uninstall Node.js on a Mac
By following these methods, you can safely and completely uninstall Node.js from your Mac.
- Method 1: Uninstall Node.js using Terminal
- Method 2: Uninstall Node.js using Homebrew
- Method 3: Uninstall Node.js using Node Version Manager (NVM)
Method 1: Uninstall Node.js using Terminal
One of the easiest and quickest ways to uninstall Node.js from your Mac is by using the Terminal app. Here are the steps to do so:
Step 1: Open the Terminal app on your Mac.
Step 2: Type the following command and press Enter to see the version of Node.js that is installed on your Mac:
node -v
Step 3: Type the following command to uninstall Node.js:
sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/man1/node.1}
Here’s a breakdown of what each part of the command means:
sudo
– this prefix grants the user superuser permissions, allowing the command to perform actions that require administrative privileges.rm
– this command stands for “remove” and is used to delete files and directories.-rf
– these flags indicate that the removal should be recursive and forceful, meaning that it will delete everything within the specified directories, including any subdirectories and their contents, without prompting for confirmation./usr/local/
– this is the directory where Node.js is typically installed on a Mac.{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/man1/node.1}
– this is a list of directories and files that should be deleted.
Breaking down the curly braces, we can see that there are three directories within the /usr/local/
directory that should be removed: bin/
, lib/node_modules/npm/
, and lib/node/
. Within the bin/
directory, two files should be removed: node
and npm
. Additionally, the share/man/man1/node.1
file, which contains Node.js manual pages, should be removed.
Overall, this command is a quick and effective way to completely uninstall Node.js and its associated files from a Mac. However, it should be used with caution, as it can also delete other important files if used improperly.
Step 4: Press Enter and enter your password when prompted.
Step 5: Type the following command and press Enter to verify that Node.js has been uninstalled:
node -v
If Node.js has been successfully uninstalled, you should see the following message: “command not found.”
Method 2: Uninstall Node.js using Homebrew
If you installed Node.js on your Mac using Homebrew, you can uninstall it using Homebrew as well. Here are the steps to do so:
Step 1: Open the Terminal app on your Mac.
Step 2: Type the following command to uninstall Node.js:
brew uninstall node
Step 3: Press Enter and wait for the uninstallation process to complete.
Step 4: Type the following command and press Enter to verify that Node.js has been uninstalled:
node -v
If Node.js has been successfully uninstalled, you should see the following message: “command not found.”
Method 3: Uninstall Node.js using Node Version Manager (NVM)
If you installed Node.js using Node Version Manager (NVM), you can uninstall it using the following steps:
Step 1: Open the Terminal app on your Mac.
Step 2: Type the following command to list the installed versions of Node.js:
nvm ls
Step 3: Type the following command to uninstall a specific version of Node.js:
nvm uninstall <version>
Replace <version>
with the version of Node.js that you want to uninstall.
Step 4: Repeat Step 3 for each version of Node.js that you want to uninstall.
Step 5: Type the following command to verify that Node.js has been uninstalled:
node -v
If Node.js has been successfully uninstalled, you should see the following message: “command not found.”
Conclusion
In conclusion, Node.js is a widely used JavaScript runtime that can be uninstalled from a Mac using several methods. The easiest and quickest way is to use the Terminal app to remove Node.js and its associated files. If you installed Node.js using Homebrew, you can use Homebrew to uninstall it. Finally, if you installed Node.js using Node Version Manager (NVM), you can use NVM to uninstall it. Regardless of the method you choose, it’s important to verify that Node.js has been successfully uninstalled by checking the version number using the node -v
command. By following these steps, you can safely and completely uninstall Node.js from your Mac.