I have a React Native project created a month ago, using create-react-native-app command.
The package.json contents are as follow:
{
"name": "TestApp2",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-native-scripts": "1.1.0",
"jest-expo": "~19.0.0",
"react-test-renderer": "16.0.0-alpha.12"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^19.0.0",
"react": "16.0.0-alpha.12",
"react-native": "^0.46.1"
}
}
When I create a project today, the package.json is as follow:
{
"name": "NewApp",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-native-scripts": "1.5.0",
"jest-expo": "^21.0.2",
"react-test-renderer": "16.0.0-alpha.12"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^21.0.0",
"react": "16.0.0-alpha.12",
"react-native": "^0.48.4"
}
}
Please note that the versions of react-native-scripts, jest-expo and expo are different. My question is, how can I upgrade the version? Should I just change the version number manually?
I tried to use:
$ npm install -g react-native-git-upgrade
$ react-native-git-upgrade
But it does not upgrade the versions.
I also tried:
$ npm update
$ react-native upgrade
But both commands don't update the versions.
Just manually update the versions in your package.json file and the re-run npm install.
Because you are using expo, you can also use its upgrade functions.
So just run expo upgrade in the root directory, look here
expo doc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With