Install NodeJS 6.x LTS on Ubuntu 16.04

Posted on Wednesday, July 26, 2017




    



This is a quick write up on how to install NodeJS 6.x LTS on Ubuntu 16.04 using the apt-get install tool.






What is the default install version?


Run this command from Ubuntu  16.04 to see what the default NodeJS install version is


  > apt-cache madison nodejs






Version 4.2.6 the LTS that was current in 2016, they year Ubuntu 16.04 came out.

I don't want that version I want the latest LTS vs 6.X



Run these commands to install a key and add a repo


  > sudo su - root
  > echo "deb https://deb.nodesource.com/node_6.x xenial main" >  /etc/apt/sources.list.d/nodesource_6.x.list


Add the key


  > curl --silent https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -




Now update


  > apt-get --assume-yes update
  > apt-get --assume-yes upgrade




Now check which version would be installed


  > apt-cache madison nodejs


 


Now install


  > apt-get --assume-yes install nodejs





Now check the versions.


  > nodejs --version




Wahoo!

And check npm


  > npm --version






Done J



References


NA





1 comment: