How to install latest stable Node.js on Ubuntu

If you develop with Node.js and you want to be sure to have the latest stable version, luckly there is a PPA for it. All you need is to follow these instructions:

sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm

That’s it!

Reference: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

3 comments

  1. Hi, just wanted to comment that for me, the last line resulted in an error:

    The following packages have unmet dependencies:
    nodejs : Conflicts: npm

    When I ran it without the npm, it worked.
    sudo apt-get install nodejs

    And npm was installed together with nodejs automatically.

  2. Clean, concise, crisp tutorial! Together with Marya’s comment, it worked like charm. I had to waste several hours following other tutorials while ago. You saved me from hours of agony. Thank you, Andrea!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>