Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Cannot find module 'graphql/validation/rules/PossibleTypeExtensions'

I am using the following book to build a MERN stack CRUD application. I'm having trouble installing and running graphql.

https://www.amazon.com/Pro-MERN-Stack-Development-Express-dp-1484243900/dp/1484243900/ref=mt_paperback?_encoding=UTF8&me=&qid= (published in 2019).

When I try to start the server contained in this repo https://github.com/vasansr/pro-mern-stack-2/tree/05.02-graphql-schema-file with the command npm start the app crashes and it returns an

Error: Cannot find module 'graphql/validation/rules/PossibleTypeExtensions'

I then followed some advice from a previous instance of this question on here to npm install karma-sinon-chai for the dependancies. But then I get the following error:

npm WARN [email protected] requires a peer of graphql@^14.2.1 but none is installed. You must install peer dependencies yourself.

like image 407
Mike McDonald Avatar asked Sep 17 '25 07:09

Mike McDonald


1 Answers

For me simply running npm install -g graphql fixed the problem (I had already installed Apollo globally with npm install -g apollo).

like image 143
Toni Sučić Avatar answered Sep 19 '25 22:09

Toni Sučić