sudo apt remove nodejs
sudo apt purge nodejs
sudo apt autoremove
After, type which node
: you should see nothing!
Otherwise, if you see a message like /usr/bin/local/node
, you must delete it with sudo rm -f /usr/bin/local/node
.
Then proceed to installation.
Type which node
. Three cases:
- Nothing is shown → directly proceed to installation.
/usr/local/bin/node
→ Node was installed with the official package./usr/local/Cellar/node
→ Node was installed with brew.
sudo rm -rf /usr/local/bin/node
sudo rm -rf /usr/local/bin/node_modules
sudo rm -rf /usr/local/bin/npm
sudo rm -rf /usr/local/bin/npx
rm -rf ~/.node
rm -rf ~/.node_modules
rm -rf ~/.npm
rm -rf ~/.npx
brew uninstall node
brew doctor
brew cleanup
brew prune
Then proceed to installation.
Open Control Panel (Panneau de Configuration), then Uninstall Programs. Then find Node.js and uninstall it.
Then proceed to installation.