Describe the bug
I installed npm install graphql-code-generator and ran gql-gen but my zsh just returns 'No command gql-gen found'.
Environment:
Additional context
Ran this on a coworker's laptop, same issue
Having issues with this too. How did you fix it?
Trying globally and locally, nothing seems to work for me.
I finally got it to run by adding it as a script and then running the script. It didnt work for me from cli
Thanks, I'll try that.
@FrankSandqvist @mhuconcern
It's a general issue with npm and yarn executables.
You should either add it as script to your package.json and then run it using yarn SCRIPT or npm run SCRIPT.
If you wish to use it as gql-gen directly, you should install it as global module (npm install -g or yarn global add).
Also, if you are using Yarn, you should be able to run yarn gql-gen.
Most helpful comment
@FrankSandqvist @mhuconcern
It's a general issue with npm and yarn executables.
You should either add it as script to your
package.jsonand then run it usingyarn SCRIPTornpm run SCRIPT.If you wish to use it as
gql-gendirectly, you should install it as global module (npm install -goryarn global add).Also, if you are using Yarn, you should be able to run
yarn gql-gen.