Reputation: 55
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?
Upvotes: 4
Views: 12375
Reputation: 2411
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
Upvotes: 4
Reputation: 187
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)
Upvotes: 0
Reputation: 2299
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
Upvotes: 4
Reputation: 1393
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
Upvotes: 0