如何在 Ubuntu 中跟上 Node.js 的最新版本?聚丙烯酰胺?编译?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7214474/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 14:30:31  来源:igfitidea点击:

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

ubuntunode.jscompilation

提问by Jo?o Pinto Jerónimo

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 ?
  • ./configure && make && ln -s ./node /usr/bin/node ?
  • Some other way you know and I can't imagine but hopefully you will share ?
  • 添加一些 PPA,它会在有新包时更新吗?
  • ./configure && make && ln -s ./node /usr/bin/node ?
  • 您知道而我无法想象的其他一些方式,但希望您能分享一下?

采纳答案by Alfred

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

您还可以使用诸如nvm 之类的工具,它可以帮助您安装节点,甚至可以有多个版本。

回答by Cris-O

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

回答by Chris Lea

I'm the maintainer of the PPA listed above. I actually maintain three distinct Node PPAs:

我是上面列出的 PPA 的维护者。我实际上维护了三个不同的 Node PPA:

https://launchpad.net/~chris-lea/+archive/node.jshttps://launchpad.net/~chris-lea/+archive/node.js-develhttps://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/+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/

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.

我目前打算继续维护这些,除非 Joyent 的人开始维护他们自己的存储库。他们让我在 IM 上,所以我通常很清楚新版本的发布时间,并且我尝试在源代码可用的一天内建立新版本。

回答by Chris Lea

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. Please see here:

从长远来看,我将在 NodeSource 组织的旗帜下制作包。请看这里:

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.

同样的我做工作,同样的功能,只是一个更好的支持系统和更多的资源来确保我做对了。享受。

回答by seler

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:

目前(2015 年 12 月)nodesource.com 为多个发行版保持最新的节点存储库。安装最新的 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 联手:)

回答by HEXcube

If it's the latest version of Node.jsyou 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:

如果您希望安装最新版本的Node.js,最简单的方法是使用Node Version Manager(NVM)。这比将 Ubuntu 中的 node 包升级到来自 PPA 或 3rd 方存储库的不受支持的版本更安全,这可能会导致 apt 包管理系统发生冲突或损坏。与 NVM 相比,从 tarball 手动安装更难维护和升级。按照以下步骤使用 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

第二步:安装节点

Once NVM installation is complete, close and reopen Terminal. Then run this command:

NVM 安装完成后,关闭并重新打开Terminal。然后运行这个命令:

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. That's all, node is installed and ready to run!

如果一切顺利,您将看到最新的 node 和 npm 版本作为输出。就是这样,节点已安装并准备运行!

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:

即使您安装了最新版本的 node,由于 node 的快速发展,您可能需要在几周或几个月后对其进行升级。NVM 使升级更容易,同时支持迁移以前安装的全局 npm 包。运行以下命令进行升级:

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