How to Fix spawnSync graphql ENOENT in Prisma

November 18, 2018

I was playing around with prisma and had an issue in the post-deploy

endpoint: ${env:PRISMA_ENDPOINT}
datamodel: datamodel.prisma
# secret: ${env:PRISMA_SECRET}
    - graphql get-schema -p prisma

Basically, I was generating schema after the Prisma is deployed using post-deploy hooks.

prisma spawnSync graphql ENOENT error

It turns out the reason for the issue is because I didn’t have graphql-cli installed on my machine globally.

Just after installing that package. The above issue got resolved.

npm i -g graphql-cli

👋 I'm Ashik Nesin • Principal Software Engineer @Chargebee 👨‍💻• I write about web development & behinds the scenes of startup/side projects that I'm building

© 2022 Nesin Technologies LLP