4

I am using EXPO and React Native, the app work running completely fine until it suddenly stopped when I made a new file and even when I deleted it, the error stayed.

I have updated React Native to V0.56.0 but it is still showing the error:

console.error: 'React Native version mismatch.

Javascript version: 0.56.0 Native Version: 0.52.0

Before I updated it was:

Javascript version: 0.54.0 Native Version: 0.52.0

and still causing the same error?

Any ideas on how I fix this and which command I use to update the Native Version?

eisbehr
  • 12,243
  • 7
  • 38
  • 63
James Dacombe
  • 55
  • 1
  • 1
  • 6
  • [This is worked for me ](https://stackoverflow.com/questions/47763824/react-native-version-mismatch) **First answer worked for me** – anil sidhu Aug 07 '18 at 12:28

4 Answers4

4

Go to package.json file inside your project folder

Where you can find code like this

"dependencies": {
    .....
    "react-native": "^0.54.0",
    ......
},

change the react-native version to 0.54 and save file.

Then go to the terminal and redirect to your project folder and hit the command

npm install  && expo start -c
Cerberus
  • 8,879
  • 1
  • 25
  • 40
Jay Thummar
  • 2,281
  • 1
  • 14
  • 22
4

This Answer is Published in 2020 and updated in 2021, Fix this Error in 3 steps:

First step: I changed the value of expo in package.json file to the latest supported version, according to expo documents(visit here).

Second step: I changed the value of sdkVersion in app.json file to the same value of expo in package.json.( equal number to last step).

Third step : I changed the value of react-native in package.json file to the same value of React Native Version , according to expo documents(visit here).

now your ready to go.

use npm install to install specified version of dependencies and then npm start to run the project

sina
  • 2,103
  • 1
  • 19
  • 26
0

I have used something like this

$ sudo npm install babel-upgrade -g
$ react-native-git-upgrade
$ npx babel-upgrade --write
$ sudo npm install babel-upgrade -g
$ npx babel-upgrade --write --install
$ react-native-git-upgrade
$ watchman watch-del-all
$ rm -rf node_modules
$ rm -rf $TMPDIR/react-*
$ rm -rf ios/Pods
$ cd ios
$ pod cache clean --all
$ pod repo update && pod install
$ cd ..
$ npm install
$ ./android/gradlew clean -p ./android/
$ rm -rf ios/build
$ react-native run-ios
$ react-native run-android
$ cd ios/
$ pod update yoga
$ pod update React/RCTNetwork
$ pod repo update
$ pod update
$ cd ..
$ pod update
$ cd ..
$ react-native run-ios
Imtee
  • 1,345
  • 13
  • 14
0

enter image description here

Javascript was one version behind the installed native version,

So, I changed the sdk version to just 1 behind Changed this line in my package.json "react-native": "https://github.com/expo/react-native/archive/sdk-38.0.0.tar.gz",

to "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz",

and saved the file, and app started working (Didn't even restart the app)

Khaja Nizamuddin
  • 167
  • 1
  • 2
  • 9