Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

post-deploy hooks failing on windows since 1.20 #3491

Closed
pedwards1 opened this issue Nov 13, 2018 · 7 comments
Closed

post-deploy hooks failing on windows since 1.20 #3491

pedwards1 opened this issue Nov 13, 2018 · 7 comments

Comments

@pedwards1
Copy link

Describe the bug
Post-deploy hooks are failing on windows since 1.20 - these were executing fine on 1.19.3.

For example using the following hook for prisma generate fails
hooks:
post-deploy:
- prisma generate

fails with:
post-deploy:
spawnSync prisma ENOENT
Running prisma generate ×

However changing 'prisma deploy' to 'prisma.cmd deploy' allows the command to be found and executed. This workaround was not required for 1.19.3. The same error and workaround also applies for other commands such as the graphql cli etc i.e. graphql get-schema fails but works when changed to graphql.cmd

To Reproduce
Steps to reproduce the behavior:

  1. add a post deploy script for 'prisma generate' using 1.20.1 prisma cli on windows
  2. run prisma deploy

Expected behavior
Prisma deploy should execute successfully

Versions (please complete the following information):

  • OS: Windiws 10
  • prisma CLI: 1.20.1
  • Prisma Server: 1.20.1
@yaacovCR
Copy link

Regression is because a recent commit upgraded npm-run to latest version. Fix #2557 had purposely downgraded npm-run to 4.1.2 because of known issue on windows, timoxley/npm-run#19.

@yaacovCR
Copy link

Pull request timoxley/npm-run#21 will hopefully fix this issue.

@divyenduz
Copy link
Contributor

@yaacovCR : Thanks for the detailed insights, you are correct that this is a regression, I will patch this up soon.

@yaacovCR
Copy link

Thanks and thank you for your work on Prisma!

@difagume
Copy link

I'm sorry I don't understand what the solution to this error is, someone can explain to me what to do, thank you

@yaacovCR
Copy link

@difagume, workaround for now is as mentioned above by @pedwards1, to change the prisma command on windows within the post-deploy hook to prisma.cmd. It seems the eventual fix will be to move back to an older version of npm-run for now, but that has not been released yet.

@anthonycaron
Copy link

Thanks @pedwards1 !
Same can be done if you're trying to execute graphql in your post-deploy then you can replace with graphql.cmd.

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

No branches or pull requests

5 participants