Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'graphql' #162

Open
Colbz opened this issue Feb 20, 2020 · 2 comments
Open

Cannot find module 'graphql' #162

Colbz opened this issue Feb 20, 2020 · 2 comments

Comments

@Colbz
Copy link

Colbz commented Feb 20, 2020

After attempting to run through CLI

npx swagger-to-graphql --swagger-schema=/path/to/swagger_schema.json > ./types.graphql

I get the error:

Cannot find module 'graphql'

Even after npm install graphql --save

@jon-harald
Copy link

Works when not using npx:

$ npm i swagger-to-graphql graphql
$ ./node_modules/.bin/swagger-to-graphql --swagger-schema=swagger_schema.json ./types.graphql

@jimmy-grande
Copy link

jimmy-grande commented Apr 6, 2020

@Colbz ,

As a workaround, if you want to only use npx, you can run the following command

npx -p graphql -p swagger-to-graphql -c "swagger-to-graphql --swagger-schema=/path/to/swagger_schema.json > ./types.graphql"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants