Eas build fails when installing dependencies, [stderr] npm ERR! ERESOLVE could not resolve

My program runs fine, but eas build fails when it runs “npm install” No matter what i do, there is always a dependency conflict. I tried running with legacy peer deps and force, clearing cache, deleting and re-installing node_modules and package-lock.json, but none of it works.
Here are the complete logs:

Running "npm install" in the root dir of your repository 

2[stderr]

npm WARN

3[stderr]

ERESOLVE overriding peer dependency

4[stderr]

npm

5[stderr]

WARN While resolving: @urql/exchange-retry@0.3.0

6[stderr]

npm

7[stderr]

WARN Found: graphql@16.6.0

8[stderr]

npm WARN node_modules/graphql

9[stderr]

npm

10[stderr]

WARN   graphql@"^16.6.0" from the root project

11[stderr]

npm WARN   3 more (@graphql-typed-document-node/core, @urql/core, graphql-tag)

12[stderr]

npm WARN 

13[stderr]

npm WARN Could not resolve dependency:

14[stderr]

npm WARN

15[stderr]

peer graphql@"^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" from @urql/exchange-retry@0.3.0

16[stderr]

npm WARN node_modules/@urql/exchange-retry

17[stderr]

npm WARN   @urql/exchange-retry@"0.3.0" from @expo/cli@0.3.2

18[stderr]

npm WARN   node_modules/@expo/cli

19[stderr]

npm WARN 

20[stderr]

npm WARN Conflicting peer dependency: graphql@15.8.0

21[stderr]

npm WARN node_modules/graphql

22[stderr]

npm WARN   peer graphql@"^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" from @urql/exchange-retry@0.3.0

23[stderr]

npm WARN   node_modules/@urql/exchange-retry

24[stderr]

npm WARN     @urql/exchange-retry@"0.3.0" from @expo/cli@0.3.2

25[stderr]

npm WARN     node_modules/@expo/cli

26[stderr]

npm ERR!

27[stderr]

code ERESOLVE

28[stderr]

npm ERR! ERESOLVE could not resolve

29[stderr]

npm ERR! 

30[stderr]

npm ERR! While resolving: aws-amplify-react-native@6.0.8

31[stderr]

npm ERR! Found: graphql@16.6.0

32[stderr]

npm ERR! node_modules/graphql

33[stderr]

npm ERR!   graphql@"^16.6.0" from the root project

34[stderr]

npm ERR!   peer graphql@"^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" from @graphql-typed-document-node/core@3.1.1

35[stderr]

npm ERR!   node_modules/@graphql-typed-document-node/core

36[stderr]

npm ERR!     @graphql-typed-document-node/core@"^3.1.0" from @urql/core@2.3.6

37[stderr]

npm ERR!     node_modules/@urql/core

38[stderr]

npm ERR!       @urql/core@"2.3.6" from @expo/cli@0.3.2

39[stderr]

npm ERR!       node_modules/@expo/cli

40[stderr]

npm ERR!         @expo/cli@"0.3.2" from expo@46.0.17

41[stderr]

npm ERR!         node_modules/expo

42[stderr]

npm ERR!       1 more (@urql/exchange-retry)

43[stderr]

npm ERR!   2 more (@urql/core, graphql-tag)

44[stderr]

npm ERR! 

45[stderr]

npm ERR! Could not resolve dependency:

46[stderr]

npm ERR! peer graphql@"^14.0.0" from aws-amplify-react-native@6.0.8

47[stderr]

npm ERR! node_modules/aws-amplify-react-native

48[stderr]

npm ERR!   aws-amplify-react-native@"^6.0.5" from the root project

49[stderr]

npm ERR! 

50[stderr]

npm ERR! Conflicting peer dependency: graphql@14.7.0

51[stderr]

npm ERR! node_modules/graphql

52[stderr]

npm ERR!   peer graphql@"^14.0.0" from aws-amplify-react-native@6.0.8

53[stderr]

npm ERR!   node_modules/aws-amplify-react-native

54[stderr]

npm ERR!     aws-amplify-react-native@"^6.0.5" from the root project

55[stderr]

npm ERR! 

56[stderr]

npm ERR! Fix the upstream dependency conflict, or retry

57[stderr]

npm ERR! this command with --force, or --legacy-peer-deps

58[stderr]

npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

59[stderr]

npm ERR! 

60[stderr]

npm ERR! See /home/expo/.npm/eresolve-report.txt for a full report.

61[stderr]


62[stderr]

npm ERR! A complete log of this run can be found in:

63[stderr]

npm ERR!     /home/expo/.npm/_logs/2022-11-28T18_43_55_385Z-debug-0.log

64npm exited with non-zero code: 1

Looking at your package.json, it seems you have dependencies mentioned such as dependencies, npm and install. You should remove them. You do not require to mention npm as a dependency in your Expo project.

Thanks for the reply, I removed those three lines but it still fails at the same spot, the error message just changed a bit, link is here Build Details — de71e2a3-1f3a-4fff-a2af-0c023d62feb9 — lbnapp_new — Expo

Full logs is this:
" ```
Running “npm install” in the root dir of your repository


2[stderr]

npm ERR!


3[stderr]

code ERESOLVE


4[stderr]

npm ERR! ERESOLVE


5[stderr]

could not resolve


6[stderr]

npm ERR!


7[stderr]

npm ERR!


8[stderr]

While resolving: @react-native-picker/picker@2.4.2


9[stderr]

npm ERR! Found: react@18.0.0


10[stderr]

npm ERR! node_modules/react


11[stderr]

npm ERR!


12[stderr]

react@“18.0.0” from the root project


13[stderr]

npm ERR! peer react@“*” from @react-navigation/core@6.4.1


14[stderr]

npm ERR! node_modules/@react-navigation/core


15[stderr]

npm ERR! @react-navigation/core@“^6.4.1” from @react-navigation/native@6.0.14


16[stderr]

npm ERR! node_modules/@react-navigation/native


17[stderr]

npm ERR! @react-navigation/native@“^6.0.12” from the root project


18[stderr]

npm ERR! 2 more (@react-navigation/elements, @react-navigation/native-stack)


19[stderr]

npm ERR! 15 more (@react-navigation/elements, …)


20[stderr]

npm ERR!


21[stderr]

npm ERR! Could not resolve dependency:


22[stderr]

npm ERR! peer react@“16 || 17” from @react-native-picker/picker@2.4.2


23[stderr]

npm ERR! node_modules/@react-native-picker/picker


24[stderr]

npm ERR! @react-native-picker/picker@“2.4.2” from the root project


25[stderr]

npm ERR! peer @react-native-picker/picker@“>=1.2” from aws-amplify-react-native@6.0.8


26[stderr]

npm ERR! node_modules/aws-amplify-react-native


27[stderr]

npm ERR! aws-amplify-react-native@“^6.0.5” from the root project


28[stderr]

npm ERR!


29[stderr]

npm ERR! Conflicting peer dependency: react@17.0.2


30[stderr]

npm ERR! node_modules/react


31[stderr]

npm ERR! peer react@“16 || 17” from @react-native-picker/picker@2.4.2


32[stderr]

npm ERR! node_modules/@react-native-picker/picker


33[stderr]

npm ERR! @react-native-picker/picker@“2.4.2” from the root project


34[stderr]

npm ERR! peer @react-native-picker/picker@“>=1.2” from aws-amplify-react-native@6.0.8


35[stderr]

npm ERR! node_modules/aws-amplify-react-native


36[stderr]

npm ERR! aws-amplify-react-native@“^6.0.5” from the root project


37[stderr]

npm ERR!


38[stderr]

npm ERR! Fix the upstream dependency conflict, or retry


39[stderr]

npm ERR! this command with --force, or --legacy-peer-deps


40[stderr]

npm ERR! to accept an incorrect (and potentially broken) dependency resolution.


41[stderr]

npm ERR!


42[stderr]

npm ERR! See /home/expo/.npm/eresolve-report.txt for a full report.


43[stderr]


44[stderr]

npm ERR! A complete log of this run can be found in:


45[stderr]

npm ERR! /home/expo/.npm/_logs/2022-11-28T22_35_04_287Z-debug-0.log


46npm exited with non-zero code: 1"

I see that your latest builds are running. Can you please confirm that it is resolved?

yes, the solution was to use yarn install instead of npm install

1 Like

hi, i have also encountered similar kind of error , while making IOS and android builds .

expo Sdk :45,

how exactly were able to resolve the issue , because when i have tried using yarn
got " ‘yarn’ is not recognized as an internal or external command"

how exactly have you resolved the dependency issues ? , and when have you used yarn install , after resolving dependency errors ?

i have got the below errors when trying to make builds

can you please help me in resolving the issue , because the builds stopped working suddenly from 2 days , before it was working fine on NOV 17 , i haven’t changed anything in the mean time , suddenly they stopped working.

It stopped working because the version of npm on EAS was updated. It was only a minor version update, so there shouldn’t be any breaking changes, but npm team is treating that as a bug fix, so the fact that incorrect configuration worked before was a bug.

And the reason for the error is that some of your peer dependencies are not compatible. The recommended approach is to fix your dependencies by resolving any conflicts listed by “npm install”. As a temporary workaround you can:

  • Add “.npmrc” file with “legacy-peer-deps=true” and commit that to your repo.
  • Delete package-lock.json and use yarn instead. It does not enforce peer dependencies.
  • Downgrade to older version of npm on EAS Build, by adding “npm install -g npm@version” in “eas-build-pre-install” script in package.json.

how exactly were able to resolve the issue , because when i have tried using yarn
got " ‘yarn’ is not recognized as an internal or external command"

you need to install yarn, it’s not bundled with node like npm is.

1 Like

here is my
package.json :-

{
“name”: “icare”,
“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”,
“eject”: “expo eject”
},
“dependencies”: {
@config-plugins/react-native-blob-util”: “^3.0.0”,
@config-plugins/react-native-pdf”: “^3.0.0”,
@react-native-async-storage/async-storage”: “~1.17.3”,
@react-native-community/datetimepicker”: “6.1.2”,
@react-native-community/slider”: “^4.3.1”,
@react-native-picker/picker”: “2.4.0”,
@react-navigation/drawer”: “^6.4.4”,
@react-navigation/native”: “^6.0.8”,
“axios”: “^0.26.0”,
“body-parser”: “^1.20.0”,
“d3-scale”: “^4.0.2”,
“deprecated-react-native-prop-types”: “^2.3.0”,
“expo”: “^45.0.0”,
“expo-app-loading”: “~2.0.0”,
“expo-dev-client”: “~1.0.1”,
“expo-document-picker”: “^10.3.0”,
“expo-file-system”: “^14.1.0”,
“expo-font”: “~10.1.0”,
“expo-media-library”: “^14.2.0”,
“expo-notifications”: “~0.15.4”,
“expo-permissions”: “~13.2.0”,
“expo-sharing”: “^10.3.0”,
“expo-splash-screen”: “~0.15.1”,
“expo-status-bar”: “~1.3.0”,
“expo-updates”: “~0.13.4”,
“is-typed-array”: “^1.1.9”,
“multiselect-react-dropdown”: “^2.0.21”,
“native-base”: “^3.3.7”,
“react”: “17.0.2”,
“react-dom”: “17.0.2”,
“react-native”: “0.68.2”,
“react-native-blob-util”: “^0.16.2”,
“react-native-dialog”: “^9.2.1”,
“react-native-document-picker”: “^8.1.1”,
“react-native-elements”: “^3.4.2”,
“react-native-gesture-handler”: “~2.2.1”,
“react-native-image-picker”: “^4.10.0”,
“react-native-keyboard-aware-scroll-view”: “^0.9.5”,
“react-native-multiple-select”: “^0.5.7”,
“react-native-otp-verify”: “^1.0.5”,
“react-native-paper”: “^4.12.2”,
“react-native-pdf”: “^6.6.2”,
“react-native-reanimated”: “^2.8.0”,
“react-native-safe-area-context”: “4.2.4”,
“react-native-screens”: “~3.11.1”,
“react-native-simple-radio-button”: “^2.7.4”,
“react-native-sound”: “^0.11.2”,
“react-native-svg”: “12.3.0”,
“react-native-svg-charts”: “^5.4.0”,
“react-native-swiper”: “^1.6.0”,
“react-native-web”: “0.17.7”,
“react-native-webview”: “^11.23.1”,
“react-navigation”: “^4.4.4”,
“react-navigation-drawer”: “^2.7.2”,
“react-select”: “^5.2.2”,
“which-typed-array”: “^1.1.8”
},
“devDependencies”: {
@babel/core”: “^7.12.9”
},
“private”: true
}

and eas.json :-

{
“cli”: {
“version”: “>= 0.60.0”
},
“build”: {
“development”: {
“developmentClient”: true,
“distribution”: “internal”
},
“preview”: {
“android”: {
“buildType”: “apk”
}
},
“preview1”: {
“distribution”: “internal”
},
“preview2”: {
“android”: {
“gradleCommand”: “:app:assembleRelease”
}
},
“production”: {}
},
“submit”: {
“production”: {}
}
}

can you help me what to change, how to do those?

when i was trying to make an android build , i was getting this error

from the above error message what i understood is @config-plugins/react-native-blob-util@3.0.0 requires expo@46.0.0 sdk , but i am still in expo @ 45.0.0 sdk

is that right or what should i do?

according to my understanding i have tried to upgrade the expo sdk to 46.0.0 (expo upgrade@46.0.0)
which is also giving error while installing npm(npm install)

i am struck here , what should i do now?

The quickest and easiest way to get around this issue is to create a file called .npmrc in the root of your project containing just: legacy-peer-deps=true.

You might also want to run expo-cli doctor and npx expo install --check to check for issues with expo dependencies.

1 Like

Thanks Wodin ,That worked for me , now i was able to make builds.
actually what does that mean ? , is it kind of temporary workaround, will it make any issues in future?

1 Like

Basically, as far as I understand it, the problem is caused by conflicting versions of peer dependencies of some of your dependencies. The lastest versions of npm are stricter about those problems than older versions.

So ideally you would update your dependencies to versions that have fixed the peer dependency version conflicts. But there might not be updated versions of the problematic dependencies.

As long as the app works correctly, you can probably ignore the issue, but if possible, try to see if there are updated deps that would get rid of the problem the “right” way.

Thanks wodin, Thanks for the Info , i will try to update the dependencies as soon as possible .

1 Like