Search code examples
node.jsreactjsreact-nativepackagepeer-dependencies

I have a peer dependency issues I cannot fix


I am trying to rebuild an app where it use an expo sdk version 45. Since it is deprecated I tried upgrading the sdk When i run npx expo-doctor I got the output

✔ Validating global prerequisites versions passed
✔ Checking for incompatible packages passed
✔ Checking for conflicting global packages in project passed
✖ Verifying prebuild support package versions are compatible failed
Issues:
  Expected package expo-modules-autolinking@~1.1.0 || ~1.2.0
  Found invalid:
    [email protected]
    (for more info, run: npm why expo-modules-autolinking)
  Expected package @expo/config-plugins@~6.0.0
  Found invalid:
    @expo/[email protected]
    (for more info, run: npm why @expo/config-plugins)
  Expected package @expo/prebuild-config@~6.0.0
  Found invalid:
    @expo/[email protected]
    (for more info, run: npm why @expo/prebuild-config)
Advice:
  • Upgrade dependencies that are using the invalid package versions.
✔ Checking dependency versions for compatibility with the installed Expo SDK passed
✔ Validating Expo Config passed
✔ Checking package.json for common issues passed

✖ Found one or more possible issues with the project. See above logs for issues and advice to resolve.

When i run npm why expo-modules-autolinking I got

[email protected]
node_modules/expo-app-loading/node_modules/expo-modules-autolinking
  expo-modules-autolinking@"~0.5.1" from @expo/[email protected]
  node_modules/expo-app-loading/node_modules/@expo/prebuild-config
    @expo/prebuild-config@"^3.0.15" from [email protected]
    node_modules/expo-app-loading/node_modules/expo-splash-screen
      expo-splash-screen@"~0.14.0" from [email protected]
      node_modules/expo-app-loading
        expo-app-loading@"~1.3.0" from the root project

[email protected]
node_modules/expo-modules-autolinking
  peer expo-modules-autolinking@">=0.8.1" from @expo/[email protected]
  node_modules/@expo/prebuild-config
    @expo/prebuild-config@"6.0.1" from @expo/[email protected]
    node_modules/@expo/cli
      @expo/cli@"0.7.1" from [email protected]
      node_modules/expo
        expo@"^48.0.0" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-app-loading/node_modules/expo-splash-screen
          expo-splash-screen@"~0.14.0" from [email protected]
          node_modules/expo-app-loading
            expo-app-loading@"~1.3.0" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-application
          expo-application@"~5.1.1" from [email protected]
          expo-application@"~5.1.0" from [email protected]
          node_modules/expo-notifications
            expo-notifications@"~0.18.1" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-constants
          expo-constants@"~14.2.1" from [email protected]
          expo-constants@"~14.2.0" from [email protected]
          node_modules/expo-asset
            expo-asset@"~8.9.1" from the root project
            expo-asset@"~8.9.1" from [email protected]
          expo-constants@"~14.2.0" from [email protected]
          node_modules/expo-auth-session
            expo-auth-session@"~4.0.3" from the root project
          expo-constants@"~14.2.0" from [email protected]
          node_modules/expo-linking
            expo-linking@"~4.0.1" from the root project
            expo-linking@"~4.0.0" from [email protected]
            node_modules/expo-auth-session
              expo-auth-session@"~4.0.3" from the root project
          expo-constants@"~14.2.0" from [email protected]
          node_modules/expo-notifications
            expo-notifications@"~0.18.1" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-crypto
          expo-crypto@"~12.2.0" from [email protected]
          node_modules/expo-auth-session
            expo-auth-session@"~4.0.3" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-dev-client
          expo-dev-client@"~2.2.1" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-dev-launcher
          expo-dev-launcher@"2.2.1" from [email protected]
          node_modules/expo-dev-client
            expo-dev-client@"~2.2.1" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-dev-menu
          expo-dev-menu@"2.2.0" from [email protected]
          node_modules/expo-dev-client
            expo-dev-client@"~2.2.1" from the root project
          expo-dev-menu@"2.2.0" from [email protected]
          node_modules/expo-dev-launcher
            expo-dev-launcher@"2.2.1" from [email protected]
            node_modules/expo-dev-client
              expo-dev-client@"~2.2.1" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-dev-menu-interface
          expo-dev-menu-interface@"1.1.1" from [email protected]
          node_modules/expo-dev-client
            expo-dev-client@"~2.2.1" from the root project
          expo-dev-menu-interface@"1.1.1" from [email protected]
          node_modules/expo-dev-menu
            expo-dev-menu@"2.2.0" from [email protected]
            node_modules/expo-dev-client
              expo-dev-client@"~2.2.1" from the root project
            expo-dev-menu@"2.2.0" from [email protected]
            node_modules/expo-dev-launcher
              expo-dev-launcher@"2.2.1" from [email protected]
              node_modules/expo-dev-client
                expo-dev-client@"~2.2.1" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-device
          expo-device@"~5.2.1" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-file-system
          expo-file-system@"~15.2.2" from [email protected]
          expo-file-system@"~15.2.0" from [email protected]
          node_modules/expo-asset
            expo-asset@"~8.9.1" from the root project
            expo-asset@"~8.9.1" from [email protected]
        peer expo@"*" from [email protected]
        node_modules/expo-font
          expo-font@"~11.1.1" from the root project
          expo-font@"~11.1.1" from [email protected]
        peer expo@"*" from [email protected]
        node_modules/expo-google-sign-in
          expo-google-sign-in@"~10.1.0" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-keep-awake
          expo-keep-awake@"~12.0.1" from [email protected]
        peer expo@"*" from [email protected]
        node_modules/expo-notifications
          expo-notifications@"~0.18.1" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-random
          expo-random@"~13.1.1" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-splash-screen
          expo-splash-screen@"~0.18.2" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-updates
          expo-updates@"~0.16.4" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-updates-interface
          expo-updates-interface@"~0.9.0" from [email protected]
          node_modules/expo-dev-client
            expo-dev-client@"~2.2.1" from the root project
          expo-updates-interface@"~0.9.0" from [email protected]
          node_modules/expo-updates
            expo-updates@"~0.16.4" from the root project
        peer expo@"*" from [email protected]
        node_modules/expo-web-browser
          expo-web-browser@"~12.1.0" from [email protected]
          node_modules/expo-auth-session
            expo-auth-session@"~4.0.3" from the root project
    @expo/prebuild-config@"6.0.1" from [email protected]
    node_modules/expo-splash-screen
      expo-splash-screen@"~0.18.2" from the root project
  expo-modules-autolinking@"1.2.0" from [email protected]
  node_modules/expo
    expo@"^48.0.0" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-app-loading/node_modules/expo-splash-screen
      expo-splash-screen@"~0.14.0" from [email protected]
      node_modules/expo-app-loading
        expo-app-loading@"~1.3.0" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-application
      expo-application@"~5.1.1" from [email protected]
      expo-application@"~5.1.0" from [email protected]
      node_modules/expo-notifications
        expo-notifications@"~0.18.1" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-constants
      expo-constants@"~14.2.1" from [email protected]
      expo-constants@"~14.2.0" from [email protected]
      node_modules/expo-asset
        expo-asset@"~8.9.1" from the root project
        expo-asset@"~8.9.1" from [email protected]
      expo-constants@"~14.2.0" from [email protected]
      node_modules/expo-auth-session
        expo-auth-session@"~4.0.3" from the root project
      expo-constants@"~14.2.0" from [email protected]
      node_modules/expo-linking
        expo-linking@"~4.0.1" from the root project
        expo-linking@"~4.0.0" from [email protected]
        node_modules/expo-auth-session
          expo-auth-session@"~4.0.3" from the root project
      expo-constants@"~14.2.0" from [email protected]
      node_modules/expo-notifications
        expo-notifications@"~0.18.1" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-crypto
      expo-crypto@"~12.2.0" from [email protected]
      node_modules/expo-auth-session
        expo-auth-session@"~4.0.3" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-dev-client
      expo-dev-client@"~2.2.1" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-dev-launcher
      expo-dev-launcher@"2.2.1" from [email protected]
      node_modules/expo-dev-client
        expo-dev-client@"~2.2.1" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-dev-menu
      expo-dev-menu@"2.2.0" from [email protected]
      node_modules/expo-dev-client
        expo-dev-client@"~2.2.1" from the root project
      expo-dev-menu@"2.2.0" from [email protected]
      node_modules/expo-dev-launcher
        expo-dev-launcher@"2.2.1" from [email protected]
        node_modules/expo-dev-client
          expo-dev-client@"~2.2.1" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-dev-menu-interface
      expo-dev-menu-interface@"1.1.1" from [email protected]
      node_modules/expo-dev-client
        expo-dev-client@"~2.2.1" from the root project
      expo-dev-menu-interface@"1.1.1" from [email protected]
      node_modules/expo-dev-menu
        expo-dev-menu@"2.2.0" from [email protected]
        node_modules/expo-dev-client
          expo-dev-client@"~2.2.1" from the root project
        expo-dev-menu@"2.2.0" from [email protected]
        node_modules/expo-dev-launcher
          expo-dev-launcher@"2.2.1" from [email protected]
          node_modules/expo-dev-client
            expo-dev-client@"~2.2.1" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-device
      expo-device@"~5.2.1" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-file-system
      expo-file-system@"~15.2.2" from [email protected]
      expo-file-system@"~15.2.0" from [email protected]
      node_modules/expo-asset
        expo-asset@"~8.9.1" from the root project
        expo-asset@"~8.9.1" from [email protected]
    peer expo@"*" from [email protected]
    node_modules/expo-font
      expo-font@"~11.1.1" from the root project
      expo-font@"~11.1.1" from [email protected]
    peer expo@"*" from [email protected]
    node_modules/expo-google-sign-in
      expo-google-sign-in@"~10.1.0" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-keep-awake
      expo-keep-awake@"~12.0.1" from [email protected]
    peer expo@"*" from [email protected]
    node_modules/expo-notifications
      expo-notifications@"~0.18.1" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-random
      expo-random@"~13.1.1" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-splash-screen
      expo-splash-screen@"~0.18.2" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-updates
      expo-updates@"~0.16.4" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-updates-interface
      expo-updates-interface@"~0.9.0" from [email protected]
      node_modules/expo-dev-client
        expo-dev-client@"~2.2.1" from the root project
      expo-updates-interface@"~0.9.0" from [email protected]
      node_modules/expo-updates
        expo-updates@"~0.16.4" from the root project
    peer expo@"*" from [email protected]
    node_modules/expo-web-browser
      expo-web-browser@"~12.1.0" from [email protected]
      node_modules/expo-auth-session
        expo-auth-session@"~4.0.3" from the root project

It seems there is a peer dependency issues. I have tried npm install --legacy-peer-deps but to no avail.


Solution

  • Try create .npmrc and insert and inside it insert:

    legacy-peer-deps=true