Skip to content
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

Require Node >=14, <=16 to install Strapi #13962

Merged
merged 7 commits into from Aug 18, 2022

Conversation

innerdvations
Copy link
Contributor

@innerdvations innerdvations commented Aug 3, 2022

What does it do?

  • Changes generated package.json files min version from >=12.x.x <=16.x.x to >=14.19.1 <=16.x.x
  • Changes the pre-install version check from >=12 to instead use the version from the generated package.json
  • Adds a warning when using a non-LTS version of node

Why is it needed?

We should notify users when they're using an unsupported version of node.

How to test it?

Run create-strapi-app with different versions of node installed

Related issue(s)/PR(s)

Nothing open

@innerdvations innerdvations added source: cli Source is cli package pr: fix This PR is fixing a bug labels Aug 3, 2022
@innerdvations
Copy link
Contributor Author

Node engine in package.json is actually set to >=14.19.1. Does Strapi require that as a minimum? If so I'll check the point version as well.

@codecov
Copy link

codecov bot commented Aug 3, 2022

Codecov Report

Merging #13962 (69ae325) into master (288dc33) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #13962   +/-   ##
=======================================
  Coverage   55.58%   55.58%           
=======================================
  Files        1275     1275           
  Lines       31824    31824           
  Branches     5732     5732           
=======================================
  Hits        17688    17688           
  Misses      12322    12322           
  Partials     1814     1814           
Flag Coverage Δ
front 58.13% <ø> (ø)
unit 49.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Convly
Convly previously requested changes Aug 3, 2022
packages/generators/app/lib/utils/check-requirements.js Outdated Show resolved Hide resolved
@innerdvations
Copy link
Contributor Author

innerdvations commented Aug 4, 2022

On further review, I discovered that other versions of node (12 and 18) do actually work to generate a new project, but node 18 fails to install dependencies (and provides the node engine error).

Given that, I don't know if I support preventing the behaviour entirely (with process.exit), I think it makes more sense to provide a warning when not using officially supported versions, but to attempt to proceed. Thoughts?

@derrickmehaffy
Copy link
Member

derrickmehaffy commented Aug 4, 2022

On further review, I discovered that other versions of node (12 and 18) do actually work to generate a new project, but node 18 fails to install dependencies (and provides the node engine error).

Given that, I don't know if I support preventing the behaviour entirely (with process.exit), I think it makes more sense to provide a warning when not using officially supported versions, but to attempt to proceed. Thoughts?

I largely disagree because if we gracefully allow users to continue (we used to) then naturally if they hit bugs, then they open issues about a version we don't support before we are ready to support it.

This caused a ton of overhead for us in the past and our stance was simply we will allow/support/add support for the node version when it becomes LTS just the same as we remove support when a versions EOL is reached.

Both of these time frames are regular and scheduled by node themselves.

https://nodejs.org/en/about/releases/

EG Node 18 becomes LTS on October 2022 and it's at this point where we can add support.

alexandrebodin
alexandrebodin previously approved these changes Aug 18, 2022
Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's working just like I would expect. Nice

@alexandrebodin alexandrebodin added this to the 4.3.5 milestone Aug 18, 2022
@innerdvations innerdvations merged commit dece14c into main Aug 18, 2022
@alexandrebodin alexandrebodin deleted the fix/preinstall-node-version-check branch August 18, 2022 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: fix This PR is fixing a bug source: cli Source is cli package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants