-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Error: Cannot find module 'graphql' apollo-server-express v2.10.1 #4949
Comments
apollo-server-express expects graphql to be installed as a peer dependency, instead of installing it itself. (Though I believe npm v7 will install it for you since it treats peer dependencies differently.) So this is working as expected. Did you see any docs that told you to install apollo-server-express without also installing graphql? (Also, apollo-server-express v2.10.1 is over a year old.) |
Yes, the apollo-server-express npm module page mentions installing it without the graphql dep: https://www.npmjs.com/package/apollo-server-express |
See #4949. This matches what we do in the docs site. I have not done an exhaustive search across READMEs for more problems like this; PRs welcome.
Thanks, I've fixed that README (in git, npmjs will be fixed at next publish): 80a9747 If anyone motivated to look at all the READMEs in this repo for more |
Why did it suddenly started breaking? |
@AnirudhaGohokar Likely due to npm v7 being released as "latest", which treats peer dependencies differently if you've started using it. |
I just came across this. I believe the docs for https://github.com/apollographql/apollo-server/tree/main/packages/apollo-server-fastify, and perhaps others needs updating as well. |
Suttendly we started to get this error and just fixed with a
npm i graphql
Graphql packages:
Node version: v8.4.0
after run
npm install
and initialize the express server we got this error:The application is running with the latet version of PM2 :)
The text was updated successfully, but these errors were encountered: