Error when installing apollo/client in react-native app

Error when installing apollo/client in react-native app


0

I am building a react native cli app and I want to use @apollo/client to reach the graphql server. But when running these commands

npm install @apollo/client graphql

I get the following error.

npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/graphql
npm ERR!   peer graphql@"^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 || ^15.0.0" from [email protected]
npm ERR!   node_modules/apollo-link
npm ERR!     apollo-link@"^1.2.14" from [email protected]
npm ERR!     node_modules/graphql-tools
npm ERR!       graphql-tools@"^4.0.5" from [email protected]
npm ERR!       node_modules/json-graphql-server
npm ERR!         json-graphql-server@"^2.3.2" from the root project
npm ERR!     apollo-link@"^1.0.0" from [email protected]
npm ERR!     node_modules/json-graphql-server/node_modules/apollo-client
npm ERR!       apollo-client@"^2.6.4" from [email protected]
npm ERR!       node_modules/json-graphql-server
npm ERR!         json-graphql-server@"^2.3.2" from the root project
npm ERR!   peer graphql@"^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" from [email protected]
npm ERR!   node_modules/apollo-utilities
npm ERR!     apollo-utilities@"^1.3.0" from [email protected]
npm ERR!     node_modules/apollo-link
npm ERR!       apollo-link@"^1.2.14" from [email protected]
npm ERR!       node_modules/graphql-tools
npm ERR!         graphql-tools@"^4.0.5" from [email protected]
npm ERR!         node_modules/json-graphql-server
npm ERR!       1 more (apollo-client)
npm ERR!     apollo-utilities@"^1.0.1" from [email protected]
npm ERR!     node_modules/graphql-tools
npm ERR!       graphql-tools@"^4.0.5" from [email protected]
npm ERR!       node_modules/json-graphql-server
npm ERR!         json-graphql-server@"^2.3.2" from the root project
npm ERR!     2 more (apollo-client, apollo-cache)
npm ERR!   8 more (express-graphql, graphql-tag, graphql-tools, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! @apollo/client@"*" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/graphql
npm ERR!   peer graphql@"^15.7.2 || ^16.0.0" from [email protected]
npm ERR!   node_modules/subscriptions-transport-ws
npm ERR!     peerOptional subscriptions-transport-ws@"^0.9.0 || ^0.11.0" from @apollo/[email protected]
npm ERR!     node_modules/@apollo/client
npm ERR!       @apollo/client@"*" 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! /home/paulin/.npm/_logs/2023-09-04T22_36_13_101Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /home/paulin/.npm/_logs/2023-09-04T22_36_13_101Z-debug-0.log
paulin@bkjp-hp-envy:~/projects/Betfien-Inc/parcel-transfer/frontend/android/app$ 

Does react native comes with garphql and apollo already installed ?
How to fix this.


Load 6 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *