I want to install a newest version of NodeJS
on Ubuntu Zesty 17.04
. But whether using apt-get or trying to download it from nodesource ppa, I always have the version 4.7.2.
Apt-get
sudo apt-get update
sudo apt-get install nodejs npm
Node PPA
curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get update
apt-get install nodejs npm
Result
$> node -v
v4.7.2
How can I get the version 6.9 of NodeJS ?
I didn't succeed to install it via apt-get or nodesource ppa. However I solved the problem by installing Node manually by following these steps :
sudo apt-get remove --purge node
tar -xzf <ARCHIVE>.tar.gz -C <YOUR_FOLDER>
ln -sf <YOUR_FOLDER>/bin/node /usr/bin/node
ln -sf <YOUR_FOLDER>/bin/node /usr/bin/nodejs
result :
I hope it helps !
To install the NodeJS any version
Best way is to use n. It is a node module that helps you to update and switch between node versions easily.
npm install n --global
n list
will list all node versions.If you want to switch to new version
6.10.2
use commandn 6.10.2