5

I just saw that warning while building my app on expo logs. Then i run expo doctor localy and the below warnings come out. I try to delete package-lock.json and node modules then run the "npm install" but couldn't fix it. Is there any way to fix it?

expo doctor log:

    √ Found all copies of expo-modules-autolinking
        Expected package expo-modules-autolinking@~0.8.1
        Found invalid:
          expo-modules-autolinking@0.5.5
          (for more info, run: npm why expo-modules-autolinking)
    
        √ Found all copies of @expo/config-plugins
        Expected package @expo/config-plugins@^4.1.0
        Found invalid:
          @expo/config-plugins@4.0.18
          (for more info, run: npm why @expo/config-plugins)
    
        √ Found all copies of @expo/prebuild-config
        Expected package @expo/prebuild-config@^4.0.0
        Found invalid:
          @expo/prebuild-config@3.1.6
          (for more info, run: npm why @expo/prebuild-config)
        
         Didn't find any issues with the project!

package.json

"@expo/config-plugins": "^4.1.5",
"@expo/prebuild-config": "^4.0.0",
"expo-modules-autolinking": "~0.8.1",
Kaøsc
  • 113
  • 1
  • 6
  • I just switched Expo SDK 46 and the warning doesn't show up anymore. – Kaøsc Dec 13 '22 at 18:17
  • I downgraded the version of expo sdk to 46, but now with expo doctor it tells me: "Cannot find module 'expo/config-plugins'". I tried installing it with npm and adopting solutions found online but it doesn't work – Cimo Dec 14 '22 at 08:47

5 Answers5

6

Hi Guys Just Add Below Code Inside Ur package.json File (Root Of Ur Project). Then Delete All node_module Files Inside Ur Project.

"resolutions": {
"@expo/config-plugins": "^4.1.0",
"@expo/prebuild-config": "^4.0.0",
"expo-modules-autolinking": "~0.8.1"
} 
NeerO
  • 71
  • 1
  • 5
  • Could you add a little more detail about why this works this way? – Ben Cox Nov 28 '22 at 22:38
  • Sure Buddy, Recently I Updated My Expo SDK 44.0.0 To 45.0.0 That Time I Faced This Issue. Expo Using Above Plugins Form SDK 45 And Above Versions So U Have To Change This Plugins As Per The Expected Version. – NeerO Nov 30 '22 at 09:57
1

As suggested here, "resolutions" work only for Yarn.

For npm, you should use "overrides" (see npm's overrides documentation).

RdC1965
  • 412
  • 5
  • 8
0

Puts this lines in your package.json :

"resolutions": {
  "expo-modules-autolinking": "~0.8.1"
},
Guillaume L.
  • 61
  • 1
  • 3
0

For Expo 45 please add below resolution:

  "resolutions": {
    "standard-version-expo/**/@expo/config-plugins": "4.1.0"
  },

More context here: https://github.com/expo-community/standard-version-expo/issues/45

Piotr Badura
  • 1,574
  • 1
  • 13
  • 17
0

"overrides" with "npm" inside the "package.json" file worked for me with Expo SDK 48

{
  "scripts": {
  },
  "dependencies": {
    "expo": "~48.0.18",
    "react": "18.2.0",
    "react-native": "0.71.8"
  },
  "overrides": {
    "expo-modules-autolinking": "~1.1.0",
    "@expo/config-plugins": "~6.0.0",
    "@expo/prebuild-config": "~6.0.0"
  }
}

Don't forget to remove the "node_modules" files and also the "package-lock.json" before "npm install"