Sentry-react-native: Unable to install sentry sdk

Created on 3 Feb 2021  路  6Comments  路  Source: getsentry/sentry-react-native

Environment

How do you use Sentry?
@sentry/[email protected] for tracking mobile app errors

Which SDK and version?
@sentry/[email protected]

Steps to Reproduce

I followed the installation steps from this site https://docs.sentry.io/platforms/react-native/

npm install --save @sentry/react-native -----> command stated that there were dependency issue.

Expected Result

successful installation of sentry sdk but it failed

Actual Result

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"16.13.1" from the root project
npm ERR!   peer react@">=16.4.1" from @sentry/[email protected]
npm ERR!   node_modules/@sentry/react-native
npm ERR!     @sentry/react-native@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from [email protected]
npm ERR! node_modules/@sentry/react-native/node_modules/react-dom
npm ERR!   peer react-dom@"15.x || 16.x || 17.x" from @sentry/[email protected]
npm ERR!   node_modules/@sentry/react-native/node_modules/@sentry/react
npm ERR!     @sentry/react@"6.0.3" from @sentry/[email protected]
npm ERR!     node_modules/@sentry/react-native
npm ERR!       @sentry/react-native@"*" 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! See /home/jenipha/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jenipha/.npm/_logs/2021-02-03T11_33_25_304Z-debug.log

Please help me find what the issue might be and my react-native version is "react": "16.13.1" and "react-native": "0.63.2",

Type Bug Awaiting Fix

All 6 comments

@jenipharachel Try bumping your react up to at least version 17.0.1.

@jennmueng Would that disrupt other dependencies like the other libraries I have used for my application?

@jenipharachel Never mind this is my mistake, 16.13.1 is the correct version corresponding to your React Native version. Does it work if you pass --legacy-peer-deps when doing the npm install? We will need to solve this issue upstream as it's coming from @sentry/react.

@jennmueng Thanks! npm install --save @sentry/react-native --legacy-peer-deps worked

馃憤 Experiencing this issue with 2.2.0 as well and this did allow me to install. The dependency from sentry-react-native for react-dom needs to be loosened please.

Closing this to consolidate with #1065

Was this page helpful?
0 / 5 - 0 ratings