简体   繁体   English

如何跟上Ubuntu中最新版本的Node.js? PPA?编译?

[英]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 ? 哪里可以(我可以?)找到最新版Node.js的.deb包吗?

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 ? 如果没有,并且因为它是一个进展非常快的项目,那么跟上Node.js发布的最简单方法是什么?

  • Adding some PPA and it will be updated when there's a new package ? 添加一些PPA,当有新包装时会更新吗?
  • ./configure && make && ln -s ./node /usr/bin/node ? ./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/ nodejs的最新ppa 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: 注意:如果您的系统没有add-apt-repository,则可以像这样安装:

sudo apt-get install python-software-properties

I'm the maintainer of the PPA listed above. 我是上面列出的PPA的维护者。 I actually maintain three distinct Node PPAs: 我实际上维护了三个不同的节点PPA:

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 https://launchpad.net/~chris-lea/+archive/node.js https://launchpad.net/~chris-lea/+archive/node.js-devel https://launchpad.net/~chris -lea / +存档/ node.js的旧式

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/ 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. 我目前打算继续维护这些,除非Joyent人员开始维护他们自己的存储库。 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. 他们让我在IM上,所以我一般都很清楚新版本何时发布,我尝试在源代码可用的一天内建立新版本。

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

me again (the maintainer of the above referenced PPA on Launchpad). 我再次(在Launchpad上的上述PPA的维护者)。

In a going forward sense, I will be making packages under the banner of the NodeSource organization. 在前瞻性意义上,我将在NodeSource组织的旗帜下制作包。 Please see here: 请看这里:

https://nodesource.com/blog/chris-lea-joins-forces-with-nodesource 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. 目前( 2015年12月 )nodesource.com为多个发行版保留了最新的节点回购。 Installing up-to-date nodej js is as simple as pasting this snippet into console: 安装最新的nodej js就像将这个片段粘贴到控制台一样简单:

# 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 您可以在此处找到有关在不同版本或不同发行版中安装节点的更多信息: https//github.com/nodesource/distributions#installation-instructions

Chris Lea PPA stopped at 0.10 and Chris joined forces with nodesource :) Chris Lea PPA在0.10停止,Chris 与nodesource联手 :)

If it's the latest version of Node.js you wish to install, the easiest method is to use Node Version Manager (NVM). 如果它是您希望安装的最新版本的Node.js ,最简单的方法是使用节点版本管理器 (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. 它比将Ubuntu中的节点包升级到PPA或第三方存储库中不受支持的版本更安全,这可能会导致apt包管理系统出现冲突或破坏。 Compared to NVM, manual installations from tarballs are harder to maintain and upgrade. 与NVM相比,tarball的手动安装更难维护和升级。 Follow these steps to install the latest node using NVM: 请按照以下步骤使用NVM安装最新节点:

Step 1: Install NVM 第1步:安装NVM

Run this command in Terminal : 终端中运行此命令:

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

Step 2: Install node 第2步:安装节点

Once NVM installation is complete, close and reopen Terminal . NVM安装完成后,关闭并重新打开终端 Then run this command: 然后运行以下命令:

nvm install node

Step 3: Check node version 第3步:检查节点版本

Run these commands: 运行以下命令:

node --version
npm --version

If everything went well, you'll see the latest node and npm versions as output. 如果一切顺利,您将看到最新的节点和npm版本作为输出。 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. NVM使升级更容易,同时支持迁移先前安装的全局npm软件包。 Run this command to upgrade: 运行此命令进行升级:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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