Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install express-graphql

I'm trying to install express-graphql but getting this error. Please, help!

npm install --save express-graphql 
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/graphql
npm ERR!   graphql@"^16.2.0" from the root project 
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer graphql@"^14.7.0 || ^15.3.0" from [email protected]
npm ERR! node_modules/express-graphql
npm ERR!   express-graphql@"*" 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.
like image 879
Udit Yadav Avatar asked May 07 '26 06:05

Udit Yadav


1 Answers

Delete the full initialized project then run the following:

npm init -y
npm install express express-graphql
npm install graphql

You should install express-graphql before graphql.

like image 113
therohantomar Avatar answered May 09 '26 01:05

therohantomar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!