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

fix(gatsby-cli): lower required react version #21522

Merged
merged 3 commits into from
Feb 17, 2020

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Feb 17, 2020

Requiring latest react version in gatsby-cli (for ink) causes trouble with npm installs - if user specified react version doesn't satisfy >= 16.8 constraint then it seems like npm can't properly resolve node_modules hierarchy

This does not take care of #19827 completely, but it limits scenario when this error will happen (with this change it should only happen when user specified version of react is in range >= 16.3 && < 16.8 (instead of >= 16.3 && 16.12):

npm WARN ink@2.7.1 requires a peer of react@>=16.8.0 but none is installed. You must install peer dependencies yourself.
gatsby-shopify-starter@0.1.0 /Users/misiek/test/marcuswelds-gatsby-test
├─┬ UNMET PEER DEPENDENCY gatsby@2.19.18-cli-react-from-ink.35
│ └─┬ gatsby-cli@2.8.30-cli-react-from-ink.162
│   └── UNMET PEER DEPENDENCY react@16.12.0 
└── react@16.7.0 

16.8.0 version is needed by ink and our ink logger (we use hooks), so can't go lower in this PR

Commits where cherry-picked from scratched attempt at fixing it completely ( #21508 )

pieh and others added 2 commits February 17, 2020 12:19
…nimal supported version to decrease changes of duplicate react instances being installed in projects
@pieh pieh requested a review from a team as a code owner February 17, 2020 11:31
Copy link
Contributor

@pvdz pvdz left a comment

Choose a reason for hiding this comment

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

Trusting your judgement

@pieh
Copy link
Contributor Author

pieh commented Feb 17, 2020

I published canary and running some manual tests to make sure react@16.8.0 is enough for CLI

@pieh
Copy link
Contributor Author

pieh commented Feb 17, 2020

Ok, manual testing with react@16.8.0 went well, so I'll go ahead and merge it

@pieh pieh merged commit 41c620b into gatsbyjs:master Feb 17, 2020
@pieh
Copy link
Contributor Author

pieh commented Feb 17, 2020

Published gatsby-cli@2.8.30 and gatsby@2.19.18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants