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 ?

  • How did you install them in the first place? – Thomas Ward Mar 26 '16 at 22:27
  • I followed some guide available on net. I closed that tab and don't know how I can recover it. I used command line to do the same. – user227495 Mar 26 '16 at 22:35
  • Then it will be very difficult to provide assistance because we do not know how it was installed in the first place. – Thomas Ward Mar 26 '16 at 22:37
  • @ThomasW. , found it sudo apt-get install curl curl --silent --location deb.nodesource.com/setup_5.x | sudo bash - sudo apt-get install nodejs – user227495 Mar 27 '16 at 1:04

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

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.