- Uninstall Node.js
brew uninstall node - Remove npm's cache and global packages
rm -rf ~/.npm ~/.npm-globalUsed nvm? Also run rm -rf ~/.nvm and delete the nvm lines from ~/.zshrc.
Check it worked
- Check it's gone
node --versionYou should see command not found.
- If you used nvm: remove it and every version
rm -rf ~/.nvm ~/.npmThen delete the nvm lines at the end of ~/.bashrc.
- If you used apt: remove that insteadNeeds sudo
sudo apt purge -y nodejs && sudo apt autoremove -y
Check it worked
- Check it's gone
node --versionOpen a new terminal. You should see command not found.
- Uninstall Node.js
winget uninstall OpenJS.NodeJS.LTS - Remove npm's leftover folders
Remove-Item -Recurse -Force "$env:APPDATA\npm", "$env:LOCALAPPDATA\npm-cache" -ErrorAction SilentlyContinue
Check it worked
- Check it's gone
node --versionOpen a new PowerShell window. You should see an error.