Skip to content

Instantly share code, notes, and snippets.

@bhubr
Last active September 30, 2019 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhubr/b643a4fcfc0d6b4540139b629efecfeb to your computer and use it in GitHub Desktop.
Save bhubr/b643a4fcfc0d6b4540139b629efecfeb to your computer and use it in GitHub Desktop.

Uninstall Node.js if it's already installed

Ubuntu

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.

MacOS

Type which node. Three cases:

  • /usr/local/bin/node → Node was installed with the official package.
  • /usr/local/Cellar/node → Node was installed with brew.

Uninstall with official package installation

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

Uninstall with brew installation

brew uninstall node
brew doctor
brew cleanup
brew prune

Then proceed to installation.

Windows

Open Control Panel (Panneau de Configuration), then Uninstall Programs. Then find Node.js and uninstall it.

Then proceed to installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment