Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command failed: npm add @sentry/react-native #647

Closed
seanchenca opened this issue Aug 12, 2024 · 6 comments
Closed

Command failed: npm add @sentry/react-native #647

seanchenca opened this issue Aug 12, 2024 · 6 comments

Comments

@seanchenca
Copy link

I tried to run

npx @sentry/wizard@latest -s -i reactNative

but got these errors:

Error: Command failed: npm add @sentry/react-native
│ npm error code ERESOLVE
│ npm error ERESOLVE could not resolve
│ npm error
│ npm error While resolving: @apollo/[email protected]
│ npm error Found: @types/[email protected]
│ npm error node_modules/@types/react
│ npm error @types/react@"" from @types/[email protected]
│ npm error node_modules/@types/hoist-non-react-statics
│ npm error @types/hoist-non-react-statics@"^3.3.1" from @expo/[email protected]
│ npm error node_modules/@expo/react-native-action-sheet
│ npm error @expo/react-native-action-sheet@"4.0.1" from [email protected]
│ npm error node_modules/react-native-gifted-chat
│ npm error react-native-gifted-chat@"^2.4.0" from the root project
│ npm error @types/hoist-non-react-statics@"
" from @types/[email protected]
│ npm error node_modules/@types/styled-components
│ npm error dev @types/styled-components@"^5.1.34" from the root project
│ npm error @types/react@"*" from @types/[email protected]
│ npm error node_modules/@types/react-native-svg-charts
│ npm error dev @types/react-native-svg-charts@"^5.0.16" from the root project
│ npm error 7 more (@types/react-native-vector-icons, ...)
│ npm error
│ npm error Could not resolve dependency:
│ npm error peer @types/react@"^16.8.0" from @apollo/[email protected]
│ npm error node_modules/@apollo/react-common
│ npm error @apollo/react-common@"^3.1.4" from the root project
│ npm error
│ npm error Conflicting peer dependency: @types/[email protected]
│ npm error node_modules/@types/react
│ npm error peer @types/react@"^16.8.0" from @apollo/[email protected]
│ npm error node_modules/@apollo/react-common
│ npm error @apollo/react-common@"^3.1.4" from the root project
│ npm error
│ npm error Fix the upstream dependency conflict, or retry
│ npm error this command with --force or --legacy-peer-deps
│ npm error to accept an incorrect (and potentially broken) dependency resolution.
│ npm error
│ npm error
│ npm error For a full report see:
│ npm error /Users/sean/.npm/_logs/2024-08-11T08_30_08_817Z-eresolve-report.txt
│ npm error A complete log of this run can be found in: /Users/sean/.npm/_logs/2024-08-11T08_30_08_817Z-debug-0.log

The log file is attached.

sentry-wizard-installation-error-1723365011065.log

@krystofwoldrich
Copy link
Member

Hi @seanchenca,
thank you for the message,

from the error log it looks like the npm add @sentry/react-native failed on resolving @apollo/[email protected], our SDK doesn't depend on this package.

Does npm install run successfully in the React Native project root?

Could you share more information about how does your project structure looks like (monorepo, package manage ...)?

What steps in the wizard led to this error?

@krystofwoldrich krystofwoldrich changed the title @sentry/wizard installation error Command failed: npm add @sentry/react-native Aug 13, 2024
@seanchenca
Copy link
Author

Hi @krystofwoldrich, thanks for the response.

This is just a typical React Native project. I tried to follow the instruction in this page: https://docs.sentry.io/platforms/react-native/ and ran:
npx @sentry/wizard@latest -s -i reactNative

Image

Yes, npm install reports no error. Below is the step led to this error:

Image

@krystofwoldrich
Copy link
Member

Thank you for the details.

The latest RN SDK (https://github.com/getsentry/sentry-react-native/releases/tag/5.29.0) requires react>=17.0.0 but one of your dependencies @apollo/[email protected] requires @types/react@"^16.8.0" which is not acceptable by the react>=17.0.0 requirement of the SDK.

What React Native and React version are you using? What version of the Sentry RN SDK are you currently using?

@seanchenca
Copy link
Author

Thanks for figuring out the problem. Here are the versions I am using:
"react": "^18.2.0"
"react-native": "^0.73.2"
"@sentry/react-native": "^5.16.0"
"@types/react": "^18.2.48"
"@types/react-native": "^0.73.0"

@Lms24
Copy link
Member

Lms24 commented Aug 20, 2024

Hi @seanchenca, I'm just stepping in here to let you know that we'll continue investigating your issue next week. This week is hackweek at Sentry, meaning our regular issue triaging is on hold (see getsentry/sentry-javascript#13421)

@krystofwoldrich
Copy link
Member

Hi @seanchenca,
since you are already using React version higher than @apollo/[email protected] accepts, you can run npm add @sentry/react-native@latest --force to suppress the error.

Note that this is not related to @sentry/react-native, but to the deprecated @apollo/[email protected] which was replaced by @apollo/client (https://github.com/apollographql/react-apollo#readme).

I'll close this since it's not the @sentry/wizard issue. But a dependency resolution problem, which has to be manually overwritten or fixed in the project, but sadly the Wizard can't help with that.

@krystofwoldrich krystofwoldrich closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants