question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to update cleanly to Expo 44

See original GitHub issue

Describe the bug

npm i --save-dev @testing-library/react-native@latest react-test-renderer@latest

Should update the dependencies to the current version using npm which has stricter peer version resolution than yarn, but it is failing.

❯ npm i --save-dev @testing-library/react-native@latest react-test-renderer@latest
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: @devhaus/dh-chat@1.2.8
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   dev react@"17.0.1" from the root project
npm ERR!   peer react@">=16.0.0" from @testing-library/react-native@9.0.0
npm ERR!   node_modules/@testing-library/react-native
npm ERR!     dev @testing-library/react-native@"9.0.0" from the root project
npm ERR!   1 more (react-native)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from react-test-renderer@17.0.2
npm ERR! node_modules/react-test-renderer
npm ERR!   dev react-test-renderer@"17.0.2" from the root project
npm ERR!   peer react-test-renderer@">=16.0.0" from @testing-library/react-native@9.0.0
npm ERR!   node_modules/@testing-library/react-native
npm ERR!     dev @testing-library/react-native@"9.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\trajano\AppData\Local\npm-cache\eresolve-report.txt for a full report.

Expected behavior

Should work, but didn’t I had to do

 npm i --save-dev  --legacy-peer-deps @testing-library/react-native@latest react-test-renderer@latest

Steps to Reproduce

From an Expo 44 project

npm i --save-dev @testing-library/react-native@latest react-test-renderer@latest

Screenshots

Versions

This is after I ran the --legacy-peer-deps

❯ npx envinfo --npmPackages react,react-native,react-test-renderer,@testing-library/react-native

  npmPackages:
    @testing-library/react-native: ^9.0.0 => 9.0.0
    react: 17.0.1 => 17.0.1
    react-native: 0.64.3 => 0.64.3
    react-test-renderer: ^17.0.2 => 17.0.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pierrezimmermannbamcommented, Mar 30, 2022

@trajano the error seems to be the same, it tries to resolve the react 17.0.2 peer dependency from react-test-renderer 17.0.2, I think it is because you’re installing react-test-renderer@“^17.0.1”, which resolves to the version 17.0.2, maybe you can try installing react-test-renderer@17.0.1 instead

1reaction
pierrezimmermannbamcommented, Mar 24, 2022

@trajano this doesn’t work because react 17.0.2 is a peer dep of react-test-renderer 17.0.2. You can either use version 17.0.1 of react-test-renderer or bump your react version to 17.0.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - Expo SDK upgrade from 44 to 46 is causing issues
as a workaround u can keep Expo version 44. just upgrade targetSdkVersion and compileSdkVersion inside android/build.gradle to 31 upload a ...
Read more >
"React Native version mismatch" errors - Expo Documentation
Run expo-cli doctor will show a warning where the react-native version you should install. If you did upgrade to newer SDK, make sure...
Read more >
expo-updates/README.md - UNPKG
If your `AppDelegate` has been customized and the diff doesn't apply cleanly, the important part is calling `[[EXUpdatesAppController sharedInstance] ...
Read more >
Expo SDK update from 42 to 46 - a lot work? : r/reactnative
Make sure everything is installed $ expo install # Upgrade your project to Expo SDK 44 (or any other version :)) $ expo...
Read more >
expo-cli | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found