Skip to content

feat: add condition for min node version #1782

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

Conversation

szymonrybczak
Copy link
Collaborator

Summary:

Closes #1768

Test Plan:

  1. Clone the repository and do all the required steps from the Contributing guide
  2. Download old version of node e.g. v12.22.12
  3. Run node packages/cli/build/bin.js start inside repo and, you should get an error You need at least Node 14 to run CLI.

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

I think it's weird that npx doesn't respect engines entry in package.json. Until it does, I'm good with this check, just let's make it less of a perf impact

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

Can you confirm this still works after extra imports? Ideally we'd have a test for that but It may be tricky to come up with a good one. Mocking process.version will not take module resolution into account and otherwise we'd need to run this through node@12

@szymonrybczak
Copy link
Collaborator Author

Yeah, I tested that with node@12 and it still works 😄

@szymonrybczak szymonrybczak merged commit 7618a67 into react-native-community:main Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npx react-native init fails with an unclear error on unsupported Node versions
3 participants