Cannot find module graphql
See original GitHub issueAfter installing with npm install -g graphql-code-generator
, I get the following error:
MacBook-Pro-2:stephanie-website ed$ gql-gen init
internal/modules/cjs/loader.js:582
throw err;
^
Error: Cannot find module 'graphql'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/opt/local/lib/node_modules/graphql-code-generator/dist/load.js:39:17)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
I’m using npm 6.5.0 Mac OS Mojave, npm is installed from Macports.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Cannot find module 'graphql' from 'apollo-link-state/lib/bundle ...
I am trying to setup React/Apollo frontend with graphql backend(elixir/phoenix). I did npm ...
Read more >graphql - npm
This defines a simple schema, with one type and one field, that resolves to a fixed value. The resolve function can return a...
Read more >Codegen:generate error, cannot find module 'graphql ...
I had successfully been able to run the following command over the past couple of weeks. But today I was faced with an...
Read more >error: cannot find module 'graphql/language/parser' - You.com
1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox > Make sure to fork this template and run yarn generate...
Read more >Cannot find module 'types/graphql' or its corresponding type ...
Ok,. So I generate a cell in a typescript project and it's complaining Cannot find module 'types/graphql' or its corresponding type ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Did you try to run
npm i graphql
?@reconbot
graphql
is defined asdevDependency
and aspeerDependency
. We don’t want to force a specific version ofgraphql
because it might result in multiple copies ofgraphql
(and that’s not a good thing, because it will produceAlso ensure that there are not multiple versions of GraphQL installed in your node_modules directory.
errors).