
Specific to Node.js, developers can choose from one of the currently supported releases and get regular automatic updates directly from NodeSource. Node.js is available as a snap package in all currently supported versions of Ubuntu. Save that to a file such as safer-curl.sh, then do chmod +x safer-curl.sh #wrapping line to add newline, ugly, but it works It should address the safety complaints from Arda's answer. Here's a solution that checks the md5sum once and compares it to the downloaded file, with an option to delete the file if the md5 sums don't match. That's all, node is installed and ready to run! 😊 If everything went well, you'll see the latest node and npm versions as output. Once NVM installation is complete, close and reopen Terminal. Run this command in Terminal: wget -qO- | bash Follow these steps to install the latest node using NVM: Compared to NVM, manual installations from tarballs are harder to maintain and upgrade.

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. If you can't use snaps for some reason, like from a WSL environment, Node Version Manager (NVM) is the way to go. Or if you prefer command line: sudo snap install node -classic Just search for node on Ubuntu Software store and install the first one.


The easiest method to install Node.js on Ubuntu is to use the snap package. Note that if you are using an alternative Ubuntu distribution such as Trisquel, the $(lsb_release -sc) command may not work, so you'd have to replace it with the compatible Ubuntu version name, for example xenial. Other versions can also be gotten with a simple change to the repo URL - consult documentation for details.

For the LTS version (6), the repository URL you should add is. This is for the latest (at time of writing) Nodejs version 7. Generally speaking, loading arbitrary data from a URL into a root shell session is not a good idea and I wish people would stop peddling it as a solution for everything - "Please just run this script I'm sending you, and also while we're at it - I have a bridge you'd probably be interested in purchasing".Īs an alternative, here's the "Ubuntu Way" of doing the same - this is basically everything the Node Source script is doing automatically, but here you can see how the system is being updated and know what repos and what keys are added to your system configuration: apt-key adv -keyserver -recv 68576280Īpt-add-repository "deb $(lsb_release -sc) main"
