graphql / express-graphql

Create a GraphQL HTTP server with Express.
MIT License
6.34k stars 538 forks source link

Cannot install with graphql 16.0.1 #790

Closed fredevery closed 1 year ago

fredevery commented 2 years ago

I get the follow error from npm when attempting to install along side graphql 16.0.1

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: admin@1.0.0
npm ERR! Found: graphql@16.0.1
npm ERR! node_modules/graphql
npm ERR!   graphql@"^16.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer graphql@"^14.7.0 || ^15.3.0" from express-graphql@0.12.0
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.
npm ERR! 
npm ERR! See /home/fred/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/fred/.npm/_logs/2021-11-23T13_30_12_157Z-debug.log
adviner commented 2 years ago

Has anyone figured out a working solution to this?

fredevery commented 2 years ago

Not an ideal solution, but I ended up having to install an older version of graphql to get this working.

adviner commented 2 years ago

I did also. I'm just wondering since no one is responding if this project will go stale

st33fn commented 2 years ago

I did also. I'm just wondering since no one is responding if this project will go stale

I created an issue as well. Would be bad if this becomes stale. Such a good project...

adviner commented 2 years ago

I did the same but haven't heard anything. What stinks is that every tutorial uses express-graphql and to this day there is no response.

jnv commented 2 years ago

Mind that PR #793 should fix the peer dependency, among other things.

romainPrignon commented 2 years ago

I couldn't wait anymore, so I fork the project: https://github.com/GeorgesTech/express-graphql Changes: https://github.com/GeorgesTech/express-graphql/pull/1 And I used it like this:

{
  "express-graphql": "https://gitpkg.now.sh/GeorgesTech/express-graphql/npmDist?chore/graphql-16",
}

gitpkg.now.sh allow me to target npmDist folder during install

I do not plan to maintain the fork for a long time I hope the issue will resolve soon

In the meantime, renovate/dependabot is happy

newbeb commented 1 year ago

FYI, Looks like they are deprecating express-graphql in favor of graphql-http: https://github.com/graphql/express-graphql/pull/816.

saihaj commented 1 year ago

This library is deprecated and it so recommended to migrate to alternatives https://github.com/graphql/express-graphql/pull/817

amerikan commented 1 year ago

From the various graphql servers alternatives, in our experience the easiest one to migrate over to, almost a drop in replacement, was GraphQL Yoga with their Express integration.