How to keep up with the latest versions of Node.js in Ubuntu? PPA? Compiling?

Ubuntunode.jsCompilation

Ubuntu Problem Overview


Where can (can I ?) find .deb packages for the latest versions of Node.js ?

If not, and because it's a project that progresses very fast, what is the easiest way to keep up with the releases of Node.js ?

  • Adding some PPA and it will be updated when there's a new package ?
  • ./configure && make && ln -s ./node /usr/bin/node ?
  • Some other way you know and I can't imagine but hopefully you will share ?

Ubuntu Solutions


Solution 1 - Ubuntu

Most up-to-date ppa for nodejs https://launchpad.net/~chris-lea/+archive/node.js/

sudo add-apt-repository ppa:chris-lea/node.js  
sudo apt-get update  
sudo apt-get install nodejs

NOTE: If your system does not have add-apt-repository, it can be installed like so:

sudo apt-get install python-software-properties

Solution 2 - Ubuntu

I'm the maintainer of the PPA listed above. I actually maintain three distinct Node PPAs:

https://launchpad.net/~chris-lea/+archive/node.js https://launchpad.net/~chris-lea/+archive/node.js-devel https://launchpad.net/~chris-lea/+archive/node.js-legacy

They contain the current release, the development release, and the "previous stable line" respectively. Here's some more info on using them:

https://chrislea.com/2013/03/15/upgrading-from-node-js-0-8-x-to-0-10-0-from-my-ppa/

I currently intend to keep maintaining these unless the Joyent folks start maintaining their own repositories. They have me on IM so I'm generally quite aware of when new releases are coming out, and I try to put up new builds within a day of the source code being available.

Solution 3 - Ubuntu

You could also use tools like for example nvm which can help you install node and even have multiple versions.

Solution 4 - Ubuntu

me again (the maintainer of the above referenced PPA on Launchpad).

In a going forward sense, I will be making packages under the banner of the NodeSource organization. Please see here:

https://nodesource.com/blog/chris-lea-joins-forces-with-nodesource

Same me doing the work, same functionality, just a better support system and more resources to make sure I'm doing things right. Enjoy.

Solution 5 - Ubuntu

For those who keep falling into this thread from search engines

Currently (Dec 2015) nodesource.com keeps up-to-date node repos for several distros. Installing up-to-date nodej js is as simple as pasting this snippet into console:

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs

You'll find more info on installing node in different version or different distributions here: https://github.com/nodesource/distributions#installation-instructions

Chris Lea PPA stopped at 0.10 and Chris joined forces with nodesource :)

Solution 6 - Ubuntu

If it's the latest version of Node.js you wish to install, the easiest method is to use Node Version Manager (NVM). It's safer than upgrading the node packages in Ubuntu to unsupported versions from PPAs or 3rd party repos, which may cause conflicts or breakages in apt package management system. Compared to NVM, manual installations from tarballs are harder to maintain and upgrade. Follow these steps to install the latest node using NVM:

#Step 1: Install NVM Run this command in Terminal:

wget -qO- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash

#Step 2: Install node Once NVM installation is complete, close and reopen Terminal. Then run this command:

nvm install node

#Step 3: Check node version Run these commands:

node --version
npm --version

If everything went well, you'll see the latest node and npm versions as output. That's all, node is installed and ready to run! 

#Keep up with the latest node Even if you install the latest version of node, you may have to upgrade it a few weeks or months later due to the fast paced development of node. NVM makes it easier to upgrade, while at the same time enabling migration of previously installed global npm packages. Run this command to upgrade:

nvm install node --reinstall-packages-from=node

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJoão Pinto JerónimoView Question on Stackoverflow
Solution 1 - UbuntuCris-OView Answer on Stackoverflow
Solution 2 - UbuntuChris LeaView Answer on Stackoverflow
Solution 3 - UbuntuAlfredView Answer on Stackoverflow
Solution 4 - UbuntuChris LeaView Answer on Stackoverflow
Solution 5 - UbuntuselerView Answer on Stackoverflow
Solution 6 - UbuntuRohan 'HEXcube' VillothView Answer on Stackoverflow