Reputation: 10358
I am upgrading my React Native app from 0.59 to 0,61. What I did was to generate a brand new project from ground up with react-native init emps_fe6
and yarn add
each module in package.json
. Also copy the components and App.js
over to the new project. Here is my new package.json
file:
{
"name": "emps_fe6",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/async-storage": "^1.6.2",
"moment": "^2.24.0",
"react": "16.9.0",
"react-native": "0.61.1",
"react-native-cli": "^2.0.1",
"react-native-confirmation-code-field": "^3.9.0",
"react-native-device-info": "^3.1.4",
"react-native-elements": "^1.2.3",
"react-native-gesture-handler": "^1.4.1",
"react-native-gifted-chat": "^0.10.1",
"react-native-keychain": "^4.0.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-modal": "^11.4.0",
"react-native-modal-datetime-picker": "^7.6.0",
"react-native-segmented-control-tab": "^3.4.1",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^4.0.10",
"socket.io-client": "2.1.1"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
Then start on Android emulator with react-native run-android
. It throws out the error of version mismatch:
I don't quite understand what causes the error, as there is no reference to version 0.59.9
in components and App.js
copied. The project is started from brand new and each module is yarn add
individually. Only thing from previous version is the components and App.js
.
Upvotes: 0
Views: 3460
Reputation: 1340
Maybe you had metro bundler running with a previous version of React Native which caused this issue. So, what I typically do when I face this problem is to start the bundler like npm start --reset-cache
. Make sure to stop any metro bundler running.
If problem persist try restarting your machine.
Upvotes: 1