Javascript Node.js 的长期支持 (LTS) 和稳定版本之间有什么区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33661274/
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-08-23 15:19:46  来源:igfitidea点击:

What are the differences between Long Term Support (LTS) and Stable versions of Node.js?

javascriptnode.jsversionv8lts

提问by AndrewMcLagan

Originally asked: What is the difference between Node.js 4.x branch with LTS (Long Term Support) and the 5.x branch (listed as Stable)?

最初问:Node.js 4.x 分支与 LTS(长期支持)和 5.x 分支(列为稳定)有什么区别?

But this is equally relevant to understanding the difference between 6.x and 7.x and, in the future, 8.x and 9.x

但这与理解 6.x 和 7.x 之间的区别以及将来的 8.x 和 9.x 之间的区别同样重要

Generally, I always lean towards the latest version for features and performance (as I now do a lot of ES6 / ES7). Is there any information on how production ready the "stable" branches are?

一般来说,我总是倾向于使用最新版本的功能和性能(因为我现在做了很多 ES6 / ES7)。是否有任何关于“稳定”分支的生产准备情况的信息?

回答by Binarytales

To understand the difference you need to understand why a Long Term Support (LTS) version of Node exists.

要了解差异,您需要了解为什么存在 Node 的长期支持 (LTS) 版本。

Node LTS is primarily aimed at enterprise use where there may be more resistance to frequent updates, extensive procurement procedures and lengthy test and quality requirements.

Node LTS 主要针对企业使用,在这种情况下,可能对频繁更新、广泛的采购程序以及冗长的测试和质量要求有更大的阻力。

From Rod Vagg a member of the Node LTS working group:

来自 Node LTS 工作组成员 Rod Vagg:

The point of establishing an LTS plan for Node is to build on top of an existing stable release cycle by delivering new new versions on a predictable schedule that have a clearly defined extended support lifecycle. While this may seem at odds with the open source tradition of “release early, release often” it is an essential requirement for enterprise application development and operations teams. It also affects companies ... that provide professional support for Node.js.

为 Node 制定 LTS 计划的重点是在现有稳定发布周期的基础上构建,通过按可预测的时间表交付具有明确定义的扩展支持生命周期的新版本。虽然这似乎与“早发布,经常发布”的开源传统不一致,但它是企业应用程序开发和运营团队的基本要求。它也会影响那些为 Node.js 提供专业支持的公司。

https://medium.com/@nodesource/essential-steps-long-term-support-for-node-js-8ecf7514dbd#.za353bn08

https://medium.com/@nodesource/essential-steps-long-term-support-for-node-js-8ecf7514dbd#.za353bn08

The official Node post mentioned in one of the comments also does a fine job of explaining this:

其中一条评论中提到的官方节点帖子也很好地解释了这一点:

https://nodejs.org/en/blog/community/node-v5/

https://nodejs.org/en/blog/community/node-v5/

It is sometimes misunderstood that odd version number releases (v5, v7) are a "beta" of the next LTS release. This is a convention used in other project but not in Node and is somewhat misleading. In fact, the next LTS release is chosen from a specific point release of the current version, and this will usually be an even version release (v6, v8). It's not that the latest versions are betas - it's that the LTS releases fulfil a specific need some organisations have.

有时会误解为奇数版本号版本(v5、v7)是下一个 LTS 版本的“测试版”。这是其他项目中使用的约定,但在 Node 中没有使用,并且有些误导。实际上,下一个 LTS 版本是从当前版本的特定点发布中选择的,这通常是偶数版本(v6、v8)。并不是最新版本是测试版——而是 LTS 版本满足了某些组织的特定需求。

For a point of reference look at Firefox's Extended Support Releases (https://www.mozilla.org/en-US/firefox/organizations/faq/) or Ubuntu's LTS releases (https://wiki.ubuntu.com/LTS). I don't think anyone would suggested the latest version of Firefox was a beta and that most users should stick with the older ERS versions.

有关参考点,请查看 Firefox 的扩展支持版本 ( https://www.mozilla.org/en-US/firefox/organizations/faq/) 或 Ubuntu 的 LTS 版本 ( https://wiki.ubuntu.com/LTS) . 我认为没有人会建议最新版本的 Firefox 是测试版,大多数用户应该坚持使用较旧的 ERS ​​版本。

Generally if you are able to keep up with the latest stable and future Node releases you should do so. These are stable and production readyreleases with excellent community support. Unstable and experimental functionality is kept behind build and runtime flags and should not affect your day to day operations.

通常,如果您能够跟上最新的稳定版和未来的 Node 版本,您应该这样做。这些是具有出色社区支持的稳定和生产就绪版本。不稳定和实验性功能保留在构建和运行时标志之后,不应影响您的日常操作。

Generally I always lean towards the latest version for features and performance (as I now do allot of ES6 / ES7)

一般来说,我总是倾向于使用最新版本的功能和性能(就像我现在分配的 ES6 / ES7)

This would suggest to me that stable versions and beyond will suit your needs well. This will give you access to the latest and greatest language features provide by the underlying JavaScript engine (V8 or Chakra)

这向我表明稳定版本及更高版本将很好地满足您的需求。这将使您能够访问底层 JavaScript 引擎(V8 或 Chakra)提供的最新和最强大的语言功能

Of note: A significant difference between v4 (and earlier) and v5 is that v4 ships with npm v2 whereas v5 ships with npm v3. v3 of npm has some potentially breaking changes for your project in how it handles peerDependancies. The way npm v3 now tries to install a dependancies own dependancies as flat as possible and avoid duplicates may affect your projects but has been a big boon for Windows users so this may also impact your decision making.

值得注意的是:v4(及更早版本)和 v5 之间的一个显着区别是 v4 随 npm v2 一起提供,而 v5 随 npm v3 一起提供。npm v3 在处理 peerDependencies 方面对您的项目有一些潜在的破坏性更改。npm v3 现在尝试尽可能平坦地安装依赖项和避免重复项的方式可能会影响您的项目,但对 Windows 用户来说是一个很大的福音,因此这也可能会影响您的决策。

回答by Victoria French

The 4.x is the version that is currently being supported, similar to a production release. The 5.0 version is stable, but it is the upcoming version in flux and should be treated likeit is a beta or release candidate. As such you currently do not see 5.0 as an option in things like Amazon Elastic Beanstalk.

4.x 是当前受支持的版本,类似于生产版本。5.0版是稳定的,但它是在不断变化的即将到来的版本,并应被视为好像它是一个测试版或发布候选。因此,您目前没有将 5.0 视为 Amazon Elastic Beanstalk 之类的选项。

Once a Stable release line becomes LTS, no new features or breaking changes will be added to that release.

一旦稳定版本线成为 LTS,就不会向该版本添加任何新功能或重大更改。

Source

来源

回答by ümit K.

Release Types

发布类型

  • Current: Under active development. Code for the Current release is in the branch for its major version number (for example, v10.x). Node.js releases a new major version every 6 months, allowing for breaking changes. This happens in April and October every year. Releases appearing each October have a support life of 8 months. Releases appearing each April convert to LTS (see below) each October.

  • LTS: Releases that receive Long-term Support, with a focus on stability and security. Every even-numbered major version will become an LTS release. LTS releases receive 18 months of Active LTSsupport and a further 12 months of Maintenance. LTS release lines have alphabetically-ordered codenames, beginning with v4 Argon. There are no breaking changes or feature additions, except in some special circumstances.

  • 当前:正在积极开发中。当前版本的代码位于其主要版本号的分支中(例如, v10.x)。Node.js 每 6 个月发布一个新的主要版本,允许进行重大更改。这发生在每年的四月和十月。每年 10 月发布的版本的支持期限为 8 个月。每年 4 月发布的版本会在每年 10 月转换为 LTS(见下文)。

  • LTS:获得长期支持的版本,重点是稳定性和安全性。每个偶数主要版本都将成为 LTS 版本。LTS 版本获得 18 个月的主动 LTS支持和另外 12 个月的维护。LTS 发布行具有按字母顺序排列的代号,从 v4 Argon 开始。除非在某些特殊情况下,否则没有重大更改或功能添加。

Source

来源