"React Native version mismatch", but native and JS versions appear to match
See original GitHub issueSteps to Reproduce
- XDE automatically upgrade to v2.24.3
- Run iOS simulator getting “React Native version mismatch” error JavaScript version: 0.52.0 Native version: 0.54.2
- run
exp start -c
is working fine able to launch the app without issue
Workaround: downgrade to v2.23.1 https://github.com/expo/xde/releases/tag/v2.23.1
Expected Behavior
should XDE upgrade automatically?
exp diagnostics
22:38:54 [exp] There is a new version of exp available (53.0.0).
You are currently using exp 52.0.3
Run npm install -g exp
to get the latest version
22:38:54 [exp] Generating diagnostics report…
22:38:54 [exp] You can join our slack here: https://slack.expo.io/.
Environment: OS: macOS Sierra 10.12.6 Node: 6.12.3 Yarn: 1.3.2 npm: 3.10.10 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed) expo: ^25.0.0 => 25.0.0 react: 16.2.0 => 16.2.0 react-native: https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz => 0.52.0
Diagnostics report: https://exp-xde-diagnostics.s3.amazonaws.com/ken_commit-17d6c7e6-c5fd-47d0-9538-03b44945aab9.tar.gz
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
This error may only happen if, well, JS and native versions mismatch. Where do these versions come from?
Native React Native version comes from Expo SDK. Every release blog post contains information about which RN version does, eg. SDK31 is based on React Native 0.57 (source):
JS React Native version comes, to be specific, from
node_modules/react-native/package.json
.If the versions mismatch, it usually means
sdkVersion
inapp.json
points to an Expo SDK which uses different React Native than you have installed in your project.Since we use a fork of
react-native
where we can apply Expo-specific patches and fixes and we want to help developers use Expo more easily, we encourage/require use of GitHub-tagged package asreact-native
dependency. URL to which you should point yourreact-native
dependency is always stated in release notes, eg. (source):All in all, if
"react-native": "https://github.com/expo/react-native/archive/sdk-
XX
.0.0.tar.gz"
inpackage.json
matches the"sdkVersion": "
XX
.0.0"
inapp.json
, this problem shouldn’t ever occur. 🙂 Sometimes to fix this issue, I believe, you’ll need to removenode_modules
and install the dependencies again. I hope this explanation lets you reassure your project setup is correct and ready for development!I’ll close this issue tentatively, this problem shouldn’t occur in recent versions of Expo SDK and Expo CLI.
This thread has been automatically 🔒locked🔒 since there has not been any recent activity after it was closed. Oftentimes the underlying causes of old issues and steps to reproduce them are different from those of new issues. Please open a new issue for related bugs.