I am working with a react native project where the existing libraries is compiled to support Android level 29 but now it is mandatory to upgrade to level 30, so I am trying to upgrade the library by running npx react-native upgrade
info No version passed. Fetching latest...
(node:38396) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
info Fetching diff between v0.61.5 and v0.65.1...
info Applying diff...
warn Excluding files that exist in the template, but not in your project:
error Automatically applying diff failed. We did our best to automatically upgrade as many files as possible
warn Continuing after failure. Some of the files are upgraded but you will need to deal with conflicts manually
info Installing "react-native@0.65.1" and its peer dependencies...
error Command failed: npm install --save --save-exact react-native@0.65.1 react@17.0.2
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @react-native-community/async-storage@1.11.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"17.0.2" from the root project
npm ERR! peer react@"*" from @react-native-community/checkbox@0.4.2
npm ERR! node_modules/@react-native-community/checkbox
npm ERR! @react-native-community/checkbox@"^0.4.2" from the root project
npm ERR! 16 more (@react-native-community/datetimepicker, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8" from @react-native-community/async-storage@1.11.0
npm ERR! node_modules/@react-native-community/async-storage
npm ERR! @react-native-community/async-storage@"^1.8.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react@16.14.0
npm ERR! node_modules/react
npm ERR! peer react@"^16.8" from @react-native-community/async-storage@1.11.0
npm ERR! node_modules/@react-native-community/async-storage
npm ERR! @react-native-community/async-storage@"^1.8.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
I see ex. async-storage is causing the trouble here. I attach my package.json here, please guide me through the upgrade process?
"dependencies": {
"@react-native-community/async-storage": "^1.8.1",
"@react-native-community/checkbox": "^0.4.2",
"@react-native-community/datetimepicker": "^2.4.3",
"@react-native-community/masked-view": "^0.1.7",
"@react-native-firebase/app": "^8.1.0",
"@react-native-firebase/messaging": "^7.4.1",
"@react-navigation/bottom-tabs": "^5.2.4",
"@react-navigation/native": "^5.1.0",
"@react-navigation/stack": "^5.2.1",
"base-64": "^0.1.0",
"es6-shim": "^0.35.5",
"events": "^3.2.0",
"i18n-js": "^3.5.1",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-24h-timepicker": "^1.1.0",
"react-native-common-date-picker": "^2.3.1",
"react-native-date-picker": "^3.2.5",
"react-native-document-picker": "^4.0.0",
"react-native-elements": "^1.2.7",
"react-native-file-type": "0.0.8",
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "^1.6.0",
"react-native-linear-gradient": "^2.5.6",
"react-native-localize": "^1.3.4",
"react-native-popup-menu": "^0.15.7",
"react-native-push-notification": "^4.0.0",
"react-native-reanimated": "^1.7.0",
"react-native-safe-area-context": "^0.7.3",
"react-native-screens": "^2.3.0",
"react-native-snap-carousel": "^3.8.4",
"react-native-svg": "^12.0.3",
"react-native-svg-charts": "^5.3.0",
"react-native-swipe-list-view": "^3.1.0",
"react-native-vector-icons": "^6.6.0",
"react-native-view-overflow": "0.0.5",
"react-relay": "^9.1.0",
"relay-runtime": "^9.1.0",
"rn-apple-healthkit": "^0.8.0",
"rn-fetch-blob": "^0.12.0",
"styled-components": "^5.1.1",
"twilio": "^3.48.1",
"twilio-chat": "^4.0.0"
},
my target lib for react native is the latest, but of course any lower version that make android level 30 will work
"dependencies": {
"react": "17.0.2",
"react-native": "0.65.1"
},