Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expo + React Native version mismatch error ( JavaScript version: 0.55.4, Native version: 0.57.1 )

I found lots of threads about this problem, but non of them helped me out. So sorry for writing another thread for the same problem.

I am new to react-native and frankly packange.json is really painful for me to match version of dependencies.

My package.json file is as follows. And, error message is

console.error: "React Native version mismatch.

JavaScript version: 0.55.4
Native version: 0.57.1
....."

I tried delete cache and node_modules and reinstall those things using following command.

"watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/haste-map-react-native-packager-* && rm -rf node_modules/&& npm install"

What I found from googling, in most cases, it was version mismatch between expo and react-native. But I believe I am using matched version of react-native and expo from expo website Here

{
  "name": "empty-project-template",
  "main": "node_modules/expo/AppEntry.js",
  "private": true,
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject"
  },
  "dependencies": {
    "babel-core": "^7.0.0-bridge.0",
    "expo": "^30.0.0",
    "native-base": "^2.8.1",
    "react": "16.3.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz",
    "react-navigation": "^2.11.2"
  },
  "devDependencies": {
    "@babel/core": "^7.1.6",
    "regenerator-runtime": "^0.13.1"
  }
}
like image 628
harry Avatar asked Nov 20 '18 22:11

harry


2 Answers

It is better to check app.json file as well. sdkVersion in app.json should be matched to your version.

like image 72
MJK Avatar answered Jan 01 '23 06:01

MJK


run expo update. this will update all the dependencies in package .json to their latest most stable releases. this worked for me

like image 45
Ter4nno Avatar answered Jan 01 '23 06:01

Ter4nno