First open up the terminal using the keyboard shortcut Ctrl+Alt+T. Next type the following command to uninstall any previous versions completely from your system :
sudo apt purge --autoremove nodejs npm
This will remove all the previous files and folders for NodeJS (including NPM). You can run the following commands to check whether its done:
node -v
npm -v
Next, to reinstall the latest version of NodeJS (with NPM) run the following terminal commands :
sudo apt install nodejs
The above command will install the latest version of NodeJS with NPM on your system to be used afresh.
One response to “How to uninstall and reinstall NodeJS on your Linux Ubuntu system using the terminal?”
As the admin of this site is working, no doubt very rapidly it will be renowned, due to its quality contents.