Graphql-code-generator: codegen init fails (but it is documented)

Created on 27 Sep 2019  路  3Comments  路  Source: dotansimha/graphql-code-generator

Happy to remove it from docs if agreed and not issue:

Screenshot 2019-09-27 at 11 54 02

bug core

Most helpful comment

I got this same issue when I accidently installed graphql-codegen instead of @graphql-codegen/cli.

All 3 comments

Just tested it and it seems to work. @wtrocki can you please share a small repo?
Also, do you run it as global command? does your codegen installed globally?

I have removed it globally. Tried different cases.
It was fixed but it seems that npx do not work as graphql is added as peer dependency.

[wtrocki@wtrockigraph investigations ]$ npx @graphql-codegen/cli init
npx: installed 285 in 18.735s
Cannot find module 'graphql'

Feel free to close this though.

I got this same issue when I accidently installed graphql-codegen instead of @graphql-codegen/cli.

Was this page helpful?
0 / 5 - 0 ratings