Ubuntu – Reinstall NodeJS and npm

nodejsnpmreinstall

I installed NodeJS and npm in 14.04 in the hope of setting up Ionic Framework. But there seems to be something wrong and I was told to reinstall NodeJS and npm. Can someone please give me the commands to do the same ?

Best Answer

You can simply download nodejs binaries for linux from https://nodejs.org/en/download/ (preferably LTS version 4.4.3). Unzip it and place it anywhere you want (say /opt folder). Now you can link to bin/node and bin/npm commands in your ~/.bashrc file using alias

alias node='/opt/node-v4.4.3/bin/node'

alias npm='/opt/node-v4.4.3/bin/npm'

Its simplest and you know exactly your files are.

Note : Please do not use ln -s into /usr/bin as it won't work

Related Question