Reputation: 675
I have a project in react-native "0.57.8" and want to migrate to "0.60" or higher because have had several problems wanting to upload an apk to PlayStore these problems are:
Dependencies of my project:
"dependencies": {
"image-to-base64": "2.0.1",
"native-base": "2.10.0",
"pusher-js": "^4.3.1",
"react": "16.6.3",
"react-native": "0.57.8",
"react-native-camera": "1.9.1",
"react-native-datepicker": "^1.7.2",
"react-native-elements": "0.19.1",
"react-native-image-picker": "0.28.0",
"react-native-image-resizer": "1.0.0",
"react-native-onesignal": "^3.2.12",
"react-native-qrcode-scanner": "^1.2.1",
"react-native-searchable-dropdown": "^1.0.6",
"react-native-simple-time-picker": "0.2.0",
"react-native-vector-icons": "6.1.0",
"react-navigation": "2.17.0",
"react-navigation-redux-helpers": "2.0.6",
"react-redux": "5.0.7",
"redux": "4.0.1",
"redux-persist": "5.10.0",
"rn-fetch-blob": "^0.10.15",
"toggle-switch-react-native": "2.0.2",
"underscore": "1.9.1"
}
Upvotes: 0
Views: 782
Reputation: 1947
The official React Native guide to the upgrade process can be found here
It's a bit awkward because RN can not be reliably upgraded in the same way as say a web based React project might be, i.e. zap the node_modules, run npm/update the package.json The problem is the standard npm/yarn tooling struggles with upgrading the dependencies in the ios and android build folders.
The only other alternative is if no one else, or a few others are using the project, then in that case creating a new skeleton project and copying the source code across into it might be a simpler option.
Upvotes: 0
Reputation: 675
npm install
Below is this message or a similar message:
found 1040 vulnerabilities (69 low, 3 moderate, 967 high, 1 critical)
run 'npm audit fix' to fix them, or 'npm audit' for details
npm audit fix
This message or a similar message may appear:
2 package updates for 67 vulnerabilities involved breaking changes
(use 'npm audit fix --force' to install breaking changes; or refer to 'npm
audit' for steps to fix these manually)
in this case:
npm audit fix --force
New dependencies:
"dependencies": {
"image-to-base64": "2.0.1",
"native-base": "^2.13.8",
"pusher-js": "^4.3.1",
"react": "16.6.3",
"react-native": "^0.61.4",
"react-native-camera": "1.9.1",
"react-native-datepicker": "^1.7.2",
"react-native-elements": "0.19.1",
"react-native-image-picker": "0.28.0",
"react-native-image-resizer": "1.0.0",
"react-native-onesignal": "^3.5.0",
"react-native-qrcode-scanner": "^1.2.1",
"react-native-searchable-dropdown": "^1.0.6",
"react-native-simple-time-picker": "0.2.0",
"react-native-splash-screen": "^3.2.0",
"react-native-vector-icons": "6.1.0",
"react-navigation": "2.17.0",
"react-navigation-redux-helpers": "2.0.6",
"react-redux": "5.0.7",
"redux": "4.0.1",
"redux-persist": "5.10.0",
"rn-fetch-blob": "^0.10.15",
"toggle-switch-react-native": "2.0.2",
"underscore": "1.9.1"
}
Delete folders android and ios
Regenerate android and ios folders react-native-eject npm:
npm i react-native-eject
yarn add react-native-eject
react-native eject
This solves the compilation errors in JDK Objective 28 and 64 bits
Upvotes: 0
Reputation: 1814
Steps to migrate :-
1. Delete Node modules folder.
2. Open package.json in your project directory.
3. There replace 0.57.8 RN version with the latest version.
4. Save it and run npm install from terminal inside your project directory.
Furthermore, some of the Libraries stops working or you need to upgrade those as well.
I hope this helps....Thanks :)
Upvotes: 1