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

前端 未结 6 1144
清酒与你
清酒与你 2020-12-22 15:10

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

相关标签:
6条回答
  • 2020-12-22 15:48

    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!

    0 讨论(0)
  • 2020-12-22 15:50

    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.

    0 讨论(0)
  • 2020-12-22 15:52

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

    0 讨论(0)
  • 2020-12-22 15:54

    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
    
    0 讨论(0)
  • 2020-12-22 15:58

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

    0 讨论(0)
  • 2020-12-22 16:00

    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.

    0 讨论(0)
提交回复
热议问题