skip to Main Content

I’ve started using react native with expo not long ago so I am a bit lost.

When trying to build the application with the command:

eas build --profile development --platform android

The build fails when it reaches the install dependencies part

Running "npm install" in the root dir of your repository 2[stderr] npm ERR! code ERESOLVE3[stderr] npm ERR!4[stderr] ERESOLVE could not resolve5[stderr] npm ERR! 6[stderr] npm ERR!7[stderr] While resolving: @react-native-firebase/[email protected][stderr] npm ERR! Found: @react-native-firebase/[email protected][stderr] npm ERR! node_modules/@react-native-firebase/app10[stderr] npm ERR!   @react-native-firebase/app@"~15.4.0" from the root project11[stderr] npm ERR! 12[stderr] npm ERR! Could not resolve dependency:13[stderr] npm ERR! peer @react-native-firebase/app@"16.2.0" from @react-native-firebase/[email protected][stderr] npm ERR! node_modules/@react-native-firebase/auth15[stderr] npm ERR!   @react-native-firebase/auth@"^16.2.0" from the root project16[stderr] npm17[stderr] ERR! 18[stderr] npm ERR! Conflicting peer dependency: @react-native-firebase/[email protected][stderr] npm ERR! node_modules/@react-native-firebase/app20[stderr] npm ERR!   peer @react-native-firebase/app@"16.2.0" from @react-native-firebase/[email protected][stderr] npm ERR!   node_modules/@react-native-firebase/auth22[stderr] npm ERR!     @react-native-firebase/auth@"^16.2.0" from the root project23[stderr] npm ERR! 24[stderr] npm ERR! Fix the upstream dependency conflict, or retry25[stderr] npm ERR! this command with --force, or --legacy-peer-deps26[stderr] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.27[stderr] npm ERR! 28[stderr] npm ERR! See /home/expo/.npm/eresolve-report.txt for a full report.29[stderr] 30[stderr] npm ERR! A complete log of this run can be found in:31[stderr] npm ERR!     /home/expo/.npm/_logs/2022-11-26T18_50_07_398Z-debug-0.log32npm exited with non-zero code: 1

I have tried clearing the cache and rebuilding the app. When I try npx expo start --dev-client the app works fine.

This is my package.json:

{
    "name": "wallet",
    "version": "1.0.0",
    "main": "node_modules/expo/AppEntry.js",
    "scripts": {
        "start": "expo start",
        "android": "expo start --android",
        "ios": "expo start --ios",
        "web": "expo start --web"
    },
    "dependencies": {
        "@react-native-firebase/app": "~15.4.0",
        "@react-native-firebase/auth": "^16.2.0",
        "@react-native-google-signin/google-signin": "^8.0.1",
        "@react-navigation/bottom-tabs": "^6.4.0",
        "@react-navigation/drawer": "^6.5.0",
        "@react-navigation/material-top-tabs": "^6.3.0",
        "@react-navigation/native": "^6.0.13",
        "@react-navigation/native-stack": "^6.9.1",
        "@rneui/base": "^4.0.0-rc.7",
        "@rneui/themed": "^4.0.0-rc.7",
        "expo": "~46.0.16",
        "expo-dev-client": "~1.3.1",
        "expo-font": "~10.2.0",
        "expo-linear-gradient": "~11.4.0",
        "expo-local-authentication": "~12.3.0",
        "expo-status-bar": "~1.4.0",
        "formik": "^2.2.9",
        "moment": "^2.29.4",
        "react": "18.0.0",
        "react-native": "0.69.6",
        "react-native-gesture-handler": "~2.5.0",
        "react-native-icon-badge": "^1.1.3",
        "react-native-linear-gradient": "^2.6.2",
        "react-native-pager-view": "^5.4.24",
        "react-native-reanimated": "~2.9.1",
        "react-native-recaptcha-that-works": "^1.3.2",
        "react-native-safe-area-context": "^4.3.1",
        "react-native-screens": "~3.15.0",
        "react-native-tab-view": "^3.3.0",
        "react-native-webview": "11.23.0",
        "styled-components": "^5.3.6"
    },
    "devDependencies": {
        "@babel/core": "^7.12.9"
    },
    "private": true
}

4

Answers


  1. Chosen as BEST ANSWER

    After digging into the specific missing or conflicting dependencies, I managed to fix the issue by:

    1. deleting node_modules (from terminal) with rm -rf node_modules.
    2. update react to version 18.1.0
    3. Install react-dom 18.1.0 After all that, I managed to build the app with EAS, but after I launched it, it instantly crashed with no errors on my device.

    after debugging my device errors by connecting it to my PC, I saw that some of my expo dependencies are not updated, so I used the following: expo doctor --fix dependencies.

    After that, the app was finally. launching correctly

    Thank you, @Kaosc, for leading me to this fix.

    Some of the things above might not be connected, but that's what I did.


  2. I come a cross the same issue today while building for production. I solved with installing dependencies by:

    yarn install

    After that eas switced to yarn instead of using npm to install the packages. Hope its works for you.

    Login or Signup to reply.
  3. I did this in my terminal in the root of my project:

    expo doctor
    

    It gave me this:

    Expected package @expo/config-plugins@^5.0.2
    Found invalid:
      @expo/[email protected]
      (for more info, run: npm why @expo/config-plugins)
    Some dependencies are incompatible with the installed expo package version:
     - expo-status-bar - expected version: ~1.4.2 - actual version installed: 1.2.0
     - expo-updates - expected version: ~0.15.6 - actual version installed: 0.11.7
     - react - expected version: 18.1.0 - actual version installed: 18.2.0
     - react-dom - expected version: 18.1.0 - actual version installed: 17.0.1
     - react-native - expected version: 0.70.5 - actual version installed: 0.70.6
     - react-native-reanimated - expected version: ~2.12.0 - actual version installed: 2.13.0
     - react-native-safe-area-context - expected version: 4.4.1 - actual version installed: 3.3.2
     - react-native-screens - expected version: ~3.18.0 - actual version installed: 3.10.2
     - react-native-web - expected version: ~0.18.9 - actual version installed: 0.17.1
     - react-native-webview - expected version: 11.23.1 - actual version installed: 11.15.0
    Your project may not work correctly until you install the correct versions of the packages.
    To install the correct versions of these packages, please run: expo doctor --fix-dependencies,
    or install individual packages by running expo install [package-name ...]
    

    Then I did this:

    expo doctor --fix-dependencies
    

    Then I go this and no more errors:

    Expected package @expo/config-plugins@^5.0.2
    Found invalid:
      @expo/[email protected]
      (for more info, run: npm why @expo/config-plugins)
    Some dependencies are incompatible with the installed expo package version:
     - expo-status-bar - expected version: ~1.4.2 - actual version installed: 1.2.0
     - expo-updates - expected version: ~0.15.6 - actual version installed: 0.11.7
     - react - expected version: 18.1.0 - actual version installed: 18.2.0
     - react-dom - expected version: 18.1.0 - actual version installed: 17.0.1
     - react-native - expected version: 0.70.5 - actual version installed: 0.70.6
     - react-native-reanimated - expected version: ~2.12.0 - actual version installed: 2.13.0
     - react-native-safe-area-context - expected version: 4.4.1 - actual version installed: 3.3.2
     - react-native-screens - expected version: ~3.18.0 - actual version installed: 3.10.2
     - react-native-web - expected version: ~0.18.9 - actual version installed: 0.17.1
     - react-native-webview - expected version: 11.23.1 - actual version installed: 11.15.0
    
    This command is being executed with the global Expo CLI. Learn more: https://blog.expo.dev/the-new-expo-cli-f4250d8e3421
    To use the local CLI instead (recommended in SDK 46 and higher), run:
    › npx expo install
    
    Installing 10 SDK 47.0.0 compatible native modules using npm.
    > npm install
    
    added 10 packages, removed 97 packages, changed 33 packages, and audited 1216 packages in 2m
    
    57 packages are looking for funding
      run `npm fund` for details
    
    7 vulnerabilities (1 low, 5 high, 1 critical)
    
    To address issues that do not require attention, run:
      npm audit fix
    
    To address all issues (including breaking changes), run:
      npm audit fix --force
    
    Run `npm audit` for details.
    
    Login or Signup to reply.
  4. Delete package-lock.json and try again

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search