Graphql-code-generator: Quick Start - does not work - gql-gen: command not found

Created on 2 Feb 2019  路  3Comments  路  Source: dotansimha/graphql-code-generator

Could you please help ?

I tried follow the Quick Start.

$ npm install graphql-code-generator
$ gql-gen init

-bash: gql-gen: command not found

Most helpful comment

this seems to work: $ node_modules/.bin/gql-gen init

All 3 comments

this seems to work: $ node_modules/.bin/gql-gen init

Did you install graphql-code-generator in one directory and then change into another directory? If so, that module would not be found.

Other possible solutions would be:

  • Install globally (npm i -g graphql-code-generator # yarn global add graphql-code-generator)
  • Use npx (npx gql-gen init)
  • Install and refresh your terminal session.

If you could give your version of NPM and your OS, that would be helpful. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zenVentzi picture zenVentzi  路  3Comments

iamdanthedev picture iamdanthedev  路  3Comments

dotansimha picture dotansimha  路  3Comments

SimenB picture SimenB  路  3Comments

quolpr picture quolpr  路  3Comments