xxxxxxxxxx
import pyautogui
import time
# Open Start Menu
pyautogui.press('win')
# Search for "Add or remove programs"
pyautogui.write('Add or remove programs')
pyautogui.press('enter')
# Wait for the page to load
time.sleep(2)
# Find and click on "Node.js"
nodejs_position = pyautogui.locateCenterOnScreen('nodejs.png')
pyautogui.click(nodejs_position)
# Wait for the "Uninstall" button to appear
time.sleep(2)
# Find and click on "Uninstall"
uninstall_position = pyautogui.locateCenterOnScreen('uninstall.png')
pyautogui.click(uninstall_position)
# Follow the prompts to complete the uninstallation process
time.sleep(2)
pyautogui.press('enter')
time.sleep(2)
pyautogui.press('enter')
xxxxxxxxxx
So I set to uninstall nodejs:
sudo apt-get remove npm
sudo apt-get purge nodejs
sudo apt-get autoremove
rm -r /usr/local/bin/npm
rm -rf ~/.npm
rm -rf /opt/local/bin/node
rm -rf opt/local/include/node
rm -rf /opt/local/lib/node_modules
#You can install node using NVM (Node Version Manager)
#Do this
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
this will download and execute the NVM installation script. NVM should now be installed.
After that just use it to install node. Open a new terminal and for example do
nvm install 6.11.4
This installs node version 6.11.4, which is the latest LTS. You can install any version you want. Do
nvm ls-remote
to see all available versions and just replace the version number.
You can install any number of node versions, and switch between them using
nvm use 6.11.4
also you can set a default version using
nvm alias default 6.11.4
xxxxxxxxxx
sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}