npmexpoeas

how do i Fix the upstream dependency conflict without using --force or --legacy-peer-deps on my expo go project


npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-native-reanimated-carousel@3.5.1
npm ERR! Found: react-native-reanimated@2.14.4
npm ERR! node_modules/react-native-reanimated
npm ERR!   react-native-reanimated@"~2.14.4" from the root project
npm ERR!   peer react-native-reanimated@">= 1.0.0" from @react-navigation/drawer@6.6.6
npm ERR!   node_modules/@react-navigation/drawer
npm ERR!     @react-navigation/drawer@"^6.4.1" from the root project
npm ERR!   2 more (react-native-circular-progress-indicator, react-native-redash)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-reanimated@">=3.0.0" from react-native-reanimated-carousel@3.5.1
npm ERR! node_modules/react-native-reanimated-carousel
npm ERR!   react-native-reanimated-carousel@"^3.5.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native-reanimated@3.5.4
npm ERR! node_modules/react-native-reanimated
npm ERR!   peer react-native-reanimated@">=3.0.0" from react-native-reanimated-carousel@3.5.1
npm ERR!   node_modules/react-native-reanimated-carousel
npm ERR!     react-native-reanimated-carousel@"^3.5.1" 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.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! D:\Programs\node_modules\npm-cache\_logs\2023-11-22T06_16_20_315Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: D:\Programs\node_modules\npm-cache\_logs\2023-11-22T06_16_20_315Z-debug-0.log

I'm trying to eas build, but there is an conflict in dependency. npm install exited with non-zero code: 1

the problem can be bypass using --force or --legacy-peer-deps but it seems like not resolve the problems itself.

i already tried using npm config set legacy-peer-deps true.

but i think its not how u solve the problem

In summary, the error indicates a conflict in the versions of react-native-reanimated required by different packages in your project.Need to adjust your dependencies or use the suggested flags to force the installation.

I solved the question by using npm ls react-native-reanimated and just remove the conflicted packages.


Solution

  • Go to your package.json and in the deependancies section add:

        "react-native-reanimated" : "^3.0.0" 
    

    run npm install again and you should be good. If not, post your package.json.

    As a sidenote, please use proper formatting for code and error messages in the future. When you post it as plaintext in one huge blob, it just becomes impossible to read.

    UPDATE: It looks like react-native-svg-charts is not compatible with all the other stuff. If it is removed, then it will install. I don't know why react-native-svg-charts is incompatible, but right now I don't think there is a solution besides removing it.

    This is the set of packages I was able to find that do actually install:

    +-- @babel/core@7.23.3
    +-- @babel/preset-env@7.23.3
    +-- @react-native-community/datetimepicker@6.7.5
    +-- @react-native-picker/picker@2.4.8
    +-- @react-navigation/bottom-tabs@6.5.11
    +-- @react-navigation/core@6.4.10
    +-- @react-navigation/drawer@6.6.6
    +-- @react-navigation/elements@1.3.21
    +-- @react-navigation/material-bottom-tabs@6.2.19
    +-- @react-navigation/material-top-tabs@6.6.5
    +-- @react-navigation/native-stack@6.9.17
    +-- @react-navigation/native@6.1.9
    +-- @react-navigation/routers@6.1.9
    +-- @react-navigation/stack@6.3.20
    +-- ascii-horizontal-barchart@1.3.3
    +-- axios@1.6.2
    +-- chart-react-native@1.0.1
    +-- dotenv@16.3.1
    +-- expo-document-picker@11.2.2
    +-- expo-font@11.1.1
    +-- expo-image-picker@14.1.1
    +-- expo-image@1.0.2
    +-- expo-linear-gradient@12.1.2
    +-- expo-secure-store@12.1.1
    +-- expo-sqlite@11.1.1
    +-- expo-status-bar@1.4.4
    +-- expo-storage@48.1.0
    +-- expo@48.0.21
    +-- native-base@3.4.28
    +-- react-native-chart-kit@6.12.0
    +-- react-native-circular-progress-indicator@4.4.2
    +-- react-native-config@1.5.1
    +-- react-native-dotenv@3.4.9
    +-- react-native-gesture-handler@2.9.0
    +-- react-native-loading-modal@1.1.0
    +-- react-native-mmkv-storage@0.9.1
    +-- react-native-mmkv@2.11.0
    +-- react-native-progress-steps@1.3.4
    +-- react-native-reanimated-carousel@3.5.1
    +-- react-native-reanimated@3.5.4
    +-- react-native-safe-area-context@4.5.0
    +-- react-native-screens@3.20.0
    +-- react-native-snap-carousel@3.9.1
    +-- react-native-sqlite-storage@6.0.1
    +-- react-native-svg@14.0.0
    +-- react-native-toast-message@2.1.7
    +-- react-native-vector-icons@10.0.2
    +-- react-native@0.71.14
    +-- react@18.2.0
    +-- victory-native@36.6.12
    `-- victory@36.6.12