I am installing latest version of nodejs in my localhost. But system is always installing the 4.2.6 version.How can i install the latest version.
Commands i have used:
sudo apt-get install python-software-properties
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install nodejs
After installing i have checked:
node -v
Result:
v4.2.6
Output of apt-cache policy nodejs
:
Installed: 4.2.6~dfsg-1ubuntu4
Candidate: 4.2.6~dfsg-1ubuntu4
Version table:
*** 4.2.6~dfsg-1ubuntu4 500
500 http://archive.ubuntu.com/ubuntu xenial/universe amd64
Packages
100 /var/lib/dpkg/status
OR
Can anyone send the installation steps for installing from
node-v8.2.1-linux-x64.tar.xz
file.
Thanks
In Linux/Mac systems, there is no better way than nvm - Node Version Manager.
Install:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
Then, usage is as simple as:
nvm install 8.0
nvm use 8.0
If after reboot you will see old version, use nvm alias
to set your version as default one.
Note: If you're a happy user of new M1 Apple chip, install version 15 of Node.js with nvm, it supports it out of the box.
Hey guys if you have Ubuntu 16 try this instructions. It worked for me perfectly.Also provide your account password whenever asked in this process.
sudo su -c "echo 'deb https://deb.nodesource.com/node_8.x xenial main' >> /etc/apt/sources.list.d/nodesource.list"
sudo su -c "echo 'deb-src https://deb.nodesource.com/node_8.x xenial main' >> /etc/apt/sources.list.d/nodesource.list"
sudo apt-get update
apt-cache policy nodejs Check if the versions listed has node 8
sudo apt-get install nodejs
nodejs -v check the node version installed
This shall successfully install nodejs version 8 on your system. If you wish any other version, then change the version on step 1 and 2 it shall work successfully.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With