The Angular CLI requires a minimum Node.js version of either v14.20, v16.14 or v18.10 BUT I have v18.3 installed

huangapple go评论64阅读模式
英文:

The Angular CLI requires a minimum Node.js version of either v14.20, v16.14 or v18.10 BUT I have v18.3 installed

问题

I upgraded my Angular CLI to v16 today (previously had v14.1).

现在,每当我运行 ng 时,都会出现一个错误,提示 CLI 需要最低版本的 node.js:

Angular CLI 需要 Node.js 的最低版本为 v14.20、v16.14 或 v18.10

问题是,运行 node -v 确认我安装了 v18.3。

在这里列出的列表:https://update.angular.io/?v=14.0-16.0 表明 CLI v16 支持 node.js v18。那么,CLI 应该也支持 v18,不是吗?不确定为什么会出现错误。

英文:

I upgraded my Angular CLI to v16 today (previously had v14.1).

Now whenever I run ng I get an error saying the CLI requires a minimum version of node.js:

The Angular CLI requires a minimum Node.js version of either v14.20, v16.14 or v18.10

Thing is, running node -v confirms I have v18.3 installed.

The list here: https://update.angular.io/?v=14.0-16.0 says CLI v16 support node.js v18. Surely CLI supports v18 as well then, no? Not sure why I getting the error then.

答案1

得分: 3

支持哪些版本?

根据 Angular - 活跃支持的版本,对于 Angular v16,支持的版本是 ^16.14.0 || ^18.10.0

为什么不支持 18.3.0?

当发布了 Angular v15 时,添加了对 Node.js v18 的支持。由于当时的“当前”版本是 v18.10.0,这是最低要求的版本。而 v18.3 是比 v18.10 低且更旧的版本。

为什么只支持这些版本?

> Node.js 发布可以分为三个阶段:‘当前’、‘活跃长期支持(LTS)’和‘维护’。奇数发布线不会晋升为LTS - 它们不会经历‘活跃LTS’或‘维护’阶段。
>
> - 当前 - 应包含大部分非主要(非破坏性)的更改,这些更改会着陆在 nodejs/node 的主要分支上。
> - 活跃LTS - 经 LTS 团队审核并确定适用于该版本线的新功能、错误修复和更新,已确定为适当和稳定的内容。
> - 维护 - 临界错误修复和安全更新。可以酌情添加新功能 - 通常仅在新功能支持迁移到后续版本线的情况下。

您可以在 这里 查看更多关于这个版本周期的信息。

根据上述引用,14、16 和 18 是 LTS(目前只有 18 是 LTS,16 仍在维护),但 15 和 17 从未是 LTS。这是为什么 Angular 不在活跃支持的版本中包括这些版本的原因。

英文:

What versions are supported?

According to Angular - Actively supported versions it's ^16.14.0 || ^18.10.0 for Angular v16.

Why the 18.3.0 isn't supported?

When the Angular v15 was released the support for Node.js v18 was added. Since the "current" version of Node.js 18 was at that time v18.10.0 it's the minimal required. v18.3 is lower and older version than v18.10.

Why just these versions are supported?

> There are three phases that a Node.js release can be in: 'Current', 'Active Long Term Support (LTS)', and 'Maintenance'. Odd-numbered release lines are not promoted to LTS - they will not go through the 'Active LTS' or 'Maintenance' phases.
>
> - Current - Should incorporate most of the non-major (non-breaking)
> changes that land on nodejs/node main branch.
> - Active LTS - New features, bug fixes, and updates that have been audited by the LTS
> team and have been determined to be appropriate and stable for the
> release line.
> - Maintenance - Critical bug fixes and security updates.
> New features may be added at the discretion of the LTS team -
> typically only in cases where the new feature supports migration to
> later release lines.

You can check more about this release cycle in here

Based on the quote above the 14, 16 and 18 were LTS (currently only 18 is LTS and 16 is still maintained) but 15 and 17 were never LTS. This is a reason why Angular doesn't have these versions in the Actively supported versions.

huangapple
  • 本文由 发表于 2023年5月7日 03:03:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76190623.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定