I couldn't install node version 4.7 in Ubuntu , when i upgrade the node it shows node 4.2.6 already in newest version. I need to install npm , only node 4.7 or above will allow to install npm.
Asked
Active
Viewed 1,226 times
1
-
Possible duplicate of [updating nodejs on ubuntu 16.04](https://stackoverflow.com/questions/41195952/updating-nodejs-on-ubuntu-16-04) – Suhail Gupta Apr 17 '18 at 12:00
1 Answers
3
you can try this...
Upgrading to the latest stable version
This will update you to the latest available stable version:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Upgrading to the latest LTS version
Node also offers a long-term support (LTS) version. If you need that version (or any other), simply specify the version number you want:
sudo npm cache clean -f
sudo npm install -g n
sudo n 4.4.2
Checking your Node version
To see which version of Node is currently installed, simply run:
node -v

Piyush Jain
- 185
- 1
- 12
-
My node version is 4.2.6, npm is supported only in 4.7 or higher version. So i couldn't use the commands as you suggested. – Harshitha C Apr 18 '18 at 06:30
-
Can u pls list the commands u used from starting with necessary outputs – Piyush Jain Apr 18 '18 at 10:36