Upgrading Expo to SDK 40, unable to install packages while resolving undefined@undefined

Viewed 1650

I am on Expo SDK 37 right now and need to update to target Android 29. After I run expo upgrade, delete node modules, and run npm install I get this:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react-native@0.63.2
npm ERR! node_modules/react-native
npm ERR!   react-native@"https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.49.1" from react-native-deck-swiper@1.6.7
npm ERR! node_modules/react-native-deck-swiper
npm ERR!   react-native-deck-swiper@"^1.6.7" 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.

So I can't install my packages. I'm not sure what it means by resolving undefined@undefined. How do I fix these errors?

my package.json looks like this:

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo/vector-icons": "^12.0.0",
    "@react-native-community/datetimepicker": "3.0.4",
    "@react-native-community/masked-view": "0.1.10",
    "@react-native-firebase/app": "^8.4.7",
    "@react-navigation/bottom-tabs": "^5.6.0",
    "@react-navigation/native": "^5.6.0",
    "@react-navigation/stack": "^5.7.0",
    "base-64": "^0.1.0",
    "css-tree": "^1.1.2",
    "expo": "^40.0.0",
    "expo-ads-admob": "~8.4.0",
    "expo-cli": "^4.0.4",
    "expo-font": "~8.4.0",
    "expo-updates": "~0.4.1",
    "expo-web-browser": "~8.6.0",
    "firebase": "7.9.0",
    "formik": "^2.1.5",
    "imagemagick": "^0.1.3",
    "lodash": "^4.17.20",
    "react": "16.13.1",
    "react-circular-progressbar": "^2.0.3",
    "react-datepicker": "^3.1.3",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
    "react-native-circular-progress": "^1.3.6",
    "react-native-circular-progress-patch": "0.0.2",
    "react-native-code-push": "^6.3.0",
    "react-native-collapsible": "^1.5.3",
    "react-native-datepicker": "^1.7.2",
    "react-native-deck-swiper": "^1.6.7",
    "react-native-dropdown-picker": "^3.6.8",
    "react-native-dynamic-deck-swiper": "0.0.8",
    "react-native-gesture-handler": "~1.8.0",
    "react-native-reanimated": "~1.13.0",
    "react-native-safe-area-context": "3.1.9",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-screens": "~2.15.2",
    "react-native-svg": "12.1.0",
    "react-native-swiper": "^1.6.0-rc.3",
    "react-native-view-overflow": "0.0.5",
    "react-native-web": "~0.13.12",
    "react-navigation": "^4.3.9",
    "react-navigation-stack": "^2.7.0",
    "react-redux": "^7.2.2",
    "react-redux-firebase": "^3.0.0",
    "redux": "^4.0.5",
    "redux-firestore": "^0.13.0",
    "redux-thunk": "^2.3.0",
    "yup": "^0.29.3"
  },
  "devDependencies": {
    "@babel/core": "~7.9.0",
    "babel-preset-expo": "8.3.0"
  },
  "private": true
}
1 Answers

it looks like you are using npm 7. npm 7 was released in october 2020 and introduced breaking changes around the behavior of peerDependencies, so it will not work on many projects in the node ecosystem that were released prior to it. i'd suggest using npm 6 or yarn classic.

Related