apollo-server-express: peer dependency warnings on install

Created on 15 Apr 2020  ·  14Comments  ·  Source: apollographql/apollo-server

Installing the current version of apollo-server-express (2.12.0) with yarn yields the following peer dependency warnings:

warning "apollo-server-express > [email protected]" has incorrect peer dependency "graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 || ^14.0.0".
warning "apollo-server-express > [email protected]" has incorrect peer dependency "graphql@^0.13.0 || ^14.0.0".
warning "apollo-server-express > [email protected]" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.1 || ^14.0.2".
warning "apollo-server-express > apollo-server-core > [email protected]" has incorrect peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0".
warning "apollo-server-express > apollo-server-core > [email protected]" has incorrect peer dependency "[email protected] - 14".
warning "apollo-server-express > graphql-tools > [email protected]" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0".
warning "apollo-server-express > apollo-server-core > apollo-engine-reporting > [email protected]" has incorrect peer dependency "graphql@^14.2.1".

I guess this is due to these dependencies not yet supporting graphql-js@15?

To reproduce:

yarn add graphql apollo-server-express
  • Expected: no peer dependency warnings
  • Actual: peer dependency warnings as shown above

All 14 comments

I'm having the same problem, although according to this pr this shouldn't be an issue, but it seems it still is

I am trying to do the steps here https://www.apollographql.com/docs/apollo-server/getting-started/ and running npm install apollo-server graphql gives me this error

npm ERR! code ETARGET
npm ERR! notarget No matching version found for apollo-engine-reporting@^1.8.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget 
npm ERR! notarget It was specified as a dependency of 'apollo-server-core'
npm ERR! notarget 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/tdailey/.npm/_logs/2020-05-07T21_50_01_268Z-debug.log

and it the dependency changes every time you try to re-install

I have the OP's issue too.

Scott

Same issue here with GraphQL@^15
Had to downgrade and do npm i graphql@^14 apollo-server-express :((

Same here. Any updates?

The same here, waiting for a update

Same issue here with GraphQL@^15
Had to downgrade and do npm i graphql@^14 apollo-server-express :((

I have a same/similar problem.

"apollo-server > [email protected]" has incorrect peer dependency "graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 || ^14.0.0".

same with apollo server for koa

warning "apollo-server-koa > [email protected]" has incorrect peer dependency "graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 || ^14.0.0".
warning "apollo-server-koa > apollo-server-core > [email protected]" has incorrect peer dependency "[email protected] - 14".

Same here too with apollo-server-micro

warning "apollo-server-micro > apollo-server-core > [email protected]" has incorrect peer dependency "[email protected] - 14".

Going to handle this over at #4865.

Apollo Server v2.21.0 will fix this. I published alpha packages with version v2.21.0-alpha.0. I'd love some folks to try the alpha and let me know if it works for you! Both folks who actually use the upload feature and those who don't! It's currently in the release-2.21.0 branch, being tracked at https://github.com/apollographql/apollo-server/pull/4922

I also have this problem, and I am on 2.21.0. When I run webpack i get unresolved dependencies for graphql. I tried to install graphql myself, but I think I installed the wrong version (I ran into incompatibility issues later). Can someone tell me which version of graphql I should install?

ps I also wonder why the issue is closed (I understand that the issue is going to be fixed, but in the meantime, isn't it an open issue?)

@mnieber graphql is a peer dependency so you do need to install it yourself. (npm v7 will install peer deps for you if you're using it already.) I'd recommend the latest version, v15! Curious to hear exactly what issues you ran into!

v2.21 is out and fixes the peer dependency warnings I was seeing. If there are contexts that still produce them, comment here or open a new issue, but please include a full reproduction so I can see the issues for myself (eg, a package.json and an npm version where npm install doesn't work).

Hi @glasser, thanks for the explanation, I did not know about peer dependencies (I have some gaps in my npm knowledge). My issue only occurred when using webpack. When compiling directly with tsc I could run my code without problems. I have the impression that webpack somehow started using dependencies from the parent project (my node project was in a directory that is nested in another node project directory, though I am trying to use the child project completely stand-alone), which also explains the version incompatibility.
In the end I realized that I could achieve my goal without webpack, so I dumped it, and now I am not having any issues anymore (and I'm a bit too lazy to reproduce the webpack problem, sorry :-) ). So, all good :-).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mathroc picture mathroc  ·  3Comments

leinue picture leinue  ·  3Comments

danilobuerger picture danilobuerger  ·  3Comments

dobesv picture dobesv  ·  3Comments

stevezau picture stevezau  ·  3Comments