简体   繁体   中英

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

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 ?

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

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.

你也可以使用像nvm这样的工具来帮助你安装节点甚至有多个版本。

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.

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 :)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM