This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Vishnu
To remove Node.js from a Mac, follow these steps:
Uninstall Node.js using npm:
npm uninstall -g node
Remove the Node.js executable and the npm modules:
rm /usr/local/bin/node
rm -rf /usr/local/lib/node_modules
Remove the Node.js home directory:
rm -rf ~/.npm
Remove the npm and node directories from PATH:
vi ~/.bash_profile
Search for and delete the following lines:
export PATH=$PATH:/usr/local/bin/npm
export PATH=$PATH:/usr/local/bin/node
Save and exit the file.
Restart the terminal or run the following command:
source ~/.bash_profile
This should remove Node.js from your Mac. You can verify the uninstallation by running the following command:
node -v
If Node.js is uninstalled, you should see an error message saying that the command is not found.
Remove NVM from MacOS
To remove nvm (Node Version Manager) from your Mac, follow these steps:
Remove the nvm installation directory:
rm -rf ~/.nvm
Remove the nvm configuration from your shell profile:
vi ~/.bash_profile
Search for and delete the following lines:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Save and exit the file.
Restart the terminal or run the following command:
source ~/.bash_profile
This should remove nvm from your Mac. You can verify the uninstallation by running the following command:
nvm -v
If nvm is uninstalled, you should see an error message saying that the command is not found.
This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Vishnu
Vishnu | Sciencx (2023-01-30T16:45:30+00:00) Complete Remove/Uninstall node form mac OS. Retrieved from https://www.scien.cx/2023/01/30/complete-remove-uninstall-node-form-mac-os/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.