Skip to content

Conflicting peer dependency react-native-reanimated@"3.0.0-rc.3" #10909

@hannojg

Description

@hannojg

Current behavior

We have a client using @react-navigation/[email protected] and wants to use the latest react-native-reanimated version 3.

In @react-navigation/[email protected] package.json it says:

"peerDependencies": {
    "react-native-reanimated": ">= 1.0.0",

However, a semver check with [email protected] fails against >= 1.0.0".

The full npm install error:

➜ npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @react-navigation/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react-native-reanimated
npm ERR!   react-native-reanimated@"3.0.0-rc.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-reanimated@">= 1.0.0" from @react-navigation/[email protected]
npm ERR! node_modules/@react-navigation/drawer
npm ERR!   @react-navigation/drawer@"6.5.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react-native-reanimated
npm ERR!   peer react-native-reanimated@">= 1.0.0" from @react-navigation/[email protected]
npm ERR!   node_modules/@react-navigation/drawer
npm ERR!     @react-navigation/drawer@"6.5.0" 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.

Not an issue with using yarn though.

Expected behavior

Versions are compatible. One fix would be to add in the meantime this fix:

"peerDependencies": {
    "react-native-reanimated": ">= 1.0.0 || >= 3.0.0-rc",

Reproduction

https://github.com/hannojg/react-navigation-rea-v3-rc-install-repro

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/​bottom-tabs
  • @react-navigation/​drawer
  • @react-navigation/​material-bottom-tabs
  • @react-navigation/​material-top-tabs
  • @react-navigation/​stack
  • @react-navigation/​native-stack

Environment

  • I've removed the packages that I don't use
package version
@react-navigation/native 6.0.13
@react-navigation/drawer 6.5.0
@react-navigation/stack 6.3.1
react-native-safe-area-context 4.4.1
react-native-screens 3.17.0
react-native-gesture-handler 2.6.0
react-native-reanimated 3.0.0-rc.3
react-native 0.70.1
node 16.15.1
npm or yarn 8.11.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions