New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use v12 with node v15+ ("engines.node" field misuse) #42076
Comments
I see now that it's by design, #41822. And https://nodejs.org/en/about/releases/ says the same:
The bad thing is that I need to use nodejs bundle that comes with npm v7 which is v15+. |
Reopening since the below statement listed at https://nodejs.org/en/about/releases/ only related to use nodejs in production when in the case of Angular nodejs is used in development time/mode only (for compiling to a regular/static web resources).
|
I was also really confused to get this error message when upgrading my project to Angular 12. As you mention @vladimiry, Angular applications aren't actually served using Node.js, unless you'd explicitly run a @josephperrott: are we missing something in the above reasoning? Sorry for mentioning you explicitly, but it looks like you introduced the change 17 days ago? I feel this change unnecessarily restricts the supported Node.js versions and causes confusion for people upgrading with Node 15 or even 16 installed for no real reason? |
Totally agree, looks strange to limit node version. |
All pipelines are failing using Docker's Why cant I use Node 15.x or 16.x anymore? What is the reason? It was working with Angular 11 but not with 12? |
The reason we restrict the version of node that we are able to support is because, while at runtime of applications angular is not relying on node directly, it uses node in the language service and compiler (as well as the linker). Because these pieces rely on node, we need to be certain of the APIs that are available in the node environment in which these are running. In many ways this is our "prod" environment. Following the guidance from node, we only support the While not officially supported, other future versions of node that in the @Timebutt as you noted, I introduced the change a few weeks ago, however this change was done to more codify the support our team maintains for the versions of node. @MickL Previously, previously we were incorrectly vague in our versioning requirements. Our updated engines requirements are more specific which caused it to show as unable to be used. |
Wouldnt it be better to have a recommendation instead of forbidding to use newer versions? How it is right now it will fail hard: Local development is no more possible without use of |
@MickL Both Yarn
NPMFrom my understanding, npm only warns for engines unless |
I now feel guilty for giving a hint by referring to node's note at https://nodejs.org/en/about/releases/ 😄
Those are development things by definition. These things, of course, can be named "production" at @angular but it doesn't turn them into production things for the rest of the projects that consume @angular as one among other dependencies. I understand that introducing so strict node version restriction of course might make the processes at @angular easier but it will likely cause other teams/engineers to waste for no real reason thousands of man-hours in summary to adopt the restriction. So one could say that you are simplifying your processes at the expense of others.
Such change would affect the entire project, not just @angular dependency, which would be a very very bad thing to apply to any project (do I need to explain why? - short answer is because other dependencies normally use "engines.node" restriction by purpose). |
@vladimiry has a point here regarding the ignore-engines flag. turning it off globally is a red flag. in our pipelines we've had to downgrade node to get along with the new version which has a lot higher emotional cost than technical cost ;) |
I thought Angular was a Framework/Library not an Application 🤔 |
Node.js is a critical part of the toolset used to develop applications. Just as using a prerelease version of the Angular CLI to build an application that will be deployed to production may result in failed builds or a malfunctioning application, using a non-production ready version of Node.js may also result in a similar outcome. This can also apply to other development tools such as IDEs or even the operating system. Using non-production ready software to develop an application introduces risk that the application cannot be built or will be built incorrectly (potentially in a way that may not be obvious until after deployment). However, this is distinct from the question of whether it should be a hard error at install time. @vladimiry The Angular prerequisite page that documents the requirement of an Active or Maintenance LTS version ( https://angular.io/guide/setup-local#prerequisites) has a link to https://nodejs.org/about/releases/ |
Latest node versions are production ready, they just dont have long time support. |
The Node.js documentation appears to differ from that statement:
|
The Angular CLI and the set of framework packages (compiler, compiler-cli, localize, etc.) it directly uses are an application, though, which depends heavily on the behavior and API of Node.js. The stability of a deployed application is linked to the stability of the tools used to create it. However, as mentioned, this is distinct from the question of whether all of the packages should contain hard install errors. |
@clydin continuing the idea of your message, in order to improve "the stability" the npm/node.js should remove support for "engines.node" field and hardcode/allow LTS node.js versions only in all modes including the development mode, which is fortunately not the case. Again, I understand that introducing such restrictions apparently simplifies the processes in @angular team but I don't think that module/dependency consumers should suffer for no real but imposed reason (saying "imposed" I refer to misuse of "engines.node" field). If some dev teams, including @angular, prefer to use LTS node.js only versions for development then they just do that not forcing the others by misusing "engines.node" field. |
Node 16 is going to be the active version in october, and everything just works fine with it (if you ignore the warning), I don't really see a reason to not allow it... |
Correct. This is why I updated the issue title with |
Update: We have decided to update the field to be less restrictive (see #42205). We will work to surface the Node supported version information in the |
Closed in 1c3fe69...9f09c3b |
@alan-agius4 / @josephperrott can I expect that https://github.com/angular/angular-cli/releases/tag/v12.0.2 will fix the issue for @angular-devkit/build-optimizer and @ngtools/webpack modules? Noticed that angular/angular-cli#20796 was closed as duplicate of this issue. Right now the https://github.com/angular/angular-cli/blob/6e2c292365d1015f703bd06dd290c3d73df4bd61/package.json#L43 and https://github.com/angular/angular-cli/blob/fb21c4a968c8b4d8a3d17237d0864b795fffba49/lib/packages.ts#L88 lines don't look very promising. |
Reopening since angular-cli related stuff doesn't seem to be fixed. |
Changes the engines rule in aio to accept any node version greater than or equal to v14. This allows node v15 to work with aio. addresses angular#42076
I have reopened the CLI issue and will be closing this one as there's no more actions for the FW packages. |
@JoostK thanks for tracking the issue progress. My goal was to highlight possible omission, so we get well prepared release. |
@vladimiry the CLI release is already in the making so any change will come too late. |
Changes the engines rule in aio to accept any node version greater than or equal to v14. This allows node v15 to work with aio. addresses angular#42076 PR Close angular#42367
Changes the engines rule in aio to accept any node version greater than or equal to v14. This allows node v15 to work with aio. addresses angular#42076 PR Close angular#42367
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Description
The engine "node" is incompatible with this module. Expected version "^12.14.1 || ^14.0.0". Got "15.14.0"
Minimal Reproduction
See the issue title.
Your Environment
node v15.14.0 (npm v7.7.6).
Angular Version:
v12 stack.
The text was updated successfully, but these errors were encountered: