Reputation: 2060
After upgrading to react-native:0.60.4 I have been unable to run my app and I am getting a react-native version mismatch error.
package.json
{
"name": "abcd",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"@react-native-community/async-storage": "^1.6.1",
"jetifier": "^1.6.3",
"moment": "^2.24.0",
"react": "16.8.3",
"react-native": "^0.60.4",
"react-native-btr": "^1.1.4",
"react-native-document-picker": "^2.3.0",
"react-native-elements": "^1.1.0",
"react-native-gesture-handler": "^1.3.0",
"react-native-material-dropdown": "^0.11.1",
"react-native-modal-overlay": "^1.3.1",
"react-native-progress": "^3.6.0",
"react-native-progress-bar": "^0.1.2",
"react-native-screens": "^1.0.0-alpha.22",
"react-native-searchable-dropdown": "^1.1.1",
"react-native-simple-dialogs": "^1.1.0",
"react-native-table-component": "^1.2.0",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^3.8.1",
"react-navigation-fluid-transitions": "^0.3.1"
},
"devDependencies": {
"@babel/core": "7.4.3",
"@babel/runtime": "7.4.3",
"babel-jest": "24.7.1",
"jest": "24.7.1",
"metro-react-native-babel-preset": "0.53.1",
"react-test-renderer": "16.8.6",
"reactotron-react-native": "^3.2.2",
"reactotron-redux": "^3.1.0"
},
"jest": {
"preset": "react-native"
}
}
Upvotes: 2
Views: 1164
Reputation: 9444
There is no exact solution to this, because all systems and installations and variations versions are endless.
react-native
by using npx react-native upgrade
npm install -g react-native-cli
npx react-native init AwesomeProject
package.json
view the versions of react
and react-native
from the new project and compare them to your working projectFor example this was my working project
"expo-barcode-scanner": "~8.2.1",
"expo-linear-gradient": "~8.2.1",
"expo-status-bar": "^1.0.2",
"react": "~16.11.0",
"react-dom": "~16.11.0",
"react-native": "^0.61.4",
This was my new project Package.json
"expo-splash-screen": "^0.5.0",
"expo-status-bar": "^1.0.0",
"expo-updates": "~0.2.10",
"react": "~16.11.0",
"react-dom": "~16.11.0",
"react-native": "~0.62.2",
Then finally I used the react
and react-native
version from my new project and it all worked perfectly
here is the final code for my working project
"expo-barcode-scanner": "~8.2.1",
"expo-linear-gradient": "~8.2.1",
"expo-status-bar": "^1.0.2",
"react": "~16.11.0",
"react-dom": "~16.11.0",
"react-native": "~0.62.2",
Upvotes: 1
Reputation: 2060
Finally i fixed by my own way.
Issue solved.
Upvotes: 0
Reputation: 86
1- Close all terminal/bash screen
2- Open new bash and go to project folder
cd ~/Documents/projects/myProject
3- Run your project
react-native run-ios //react-native run-android
4- npm start in your path
myProject$ npm start
best!
Upvotes: 2
Reputation: 13926
There is a possibility that the request message to you to execute is correct. Execute the message.
watchman watch-del-all && react-native start --reset-cache
Upvotes: 0