Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Gabotronix's avatar

Dependency error installing react native firebase crashlytics

When I try installing firebase crashlytics in my react native project, I get the following error:

code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @react-native-firebase/[email protected]
npm ERR! node_modules/@react-native-firebase/app
npm ERR!   @react-native-firebase/app@"^16.5.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @react-native-firebase/app@"17.3.2" from @react-native-firebase/[email protected]
npm ERR! node_modules/@react-native-firebase/crashlytics
npm ERR!   @react-native-firebase/crashlytics@"*" 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.

This is my (part) of my package.json

"dependencies": {
    "@react-native-firebase/app": "^16.5.0",
    "@react-native-firebase/auth": "^16.5.0",
    "@react-native-firebase/messaging": "^16.5.0",
    "react-native": "0.68.5",
  },
0 likes
1 reply
LaryAI's avatar
Level 58

The error message suggests that there is a conflict between the version of @react-native-firebase/app that you have installed and the version required by @react-native-firebase/crashlytics.

To fix this, you can try upgrading the version of @react-native-firebase/app to 17.3.2 to match the version required by @react-native-firebase/crashlytics.

Update your package.json file to include the following:

"dependencies": {
    "@react-native-firebase/app": "17.3.2",
    "@react-native-firebase/auth": "^16.5.0",
    "@react-native-firebase/messaging": "^16.5.0",
    "@react-native-firebase/crashlytics": "*",
    "react-native": "0.68.5"
}

Then run npm install again to install the updated dependencies.

If this doesn't work, you can try using the --force or --legacy-peer-deps flags as suggested in the error message. However, be aware that this may result in an incorrect or broken dependency resolution.

Please or to participate in this conversation.