cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.01k stars 3.18k forks source link

cy.exec fails on windows #789

Open dwelle opened 7 years ago

dwelle commented 7 years ago

Current behavior:

image

From the bug, the path seems mangled:

  1. first part is UNIXy /c/Program
  2. There's a : inserted into the (Program Files) folder name for some reason
  3. 2nd half is in windows format (backslashes)

How to reproduce:

cy.exec('echo 42');

Additional Info (images, stack traces, etc)

On my machine is installed (and in env variables) the git-for-windows bash, which is the bash the cypress is trying to invoke.

KhushalGupta commented 1 year ago

I am facing the same issue on Cypress 12.13.0, where cy. exec(command) fails on Github Action runs on ubuntu machine, but works locally from Machine Terminal in MAC OS.

B34v0n commented 8 months ago

I'm facing the same issue on Cypress 13.6.4. When can this be solved?

MikeMcC399 commented 8 months ago

@B34v0n

I'm facing the same issue on Cypress 13.6.4. When can this be solved?

Which version of Windows and which shell / terminal window application are you using?

Running https://github.com/cypress-io/cypress-example-kitchensink/blob/master/cypress/e2e/2-advanced-examples/misc.cy.js om Windows 11, I found that cy.exec() failed in Git Bash, and ran successfully in Command Prompt and PowerShell.

B34v0n commented 8 months ago

@MikeMcC399

I'm using Windows 11 22H2 with Git Bash. I can't use PowerShell, because it is a work-computer and it's locked.

The whole company uses the git-bash and no one uses the normal cmd (for nvm for example). So I need it to work with git-bash on Windows.

MikeMcC399 commented 8 months ago

@B34v0n

Thanks for confirming that you are using Git Bash where it's a known issue. Looking back at the history, this issue has been open for over 6 years and different people have suggested different workarounds and solutions, although none have made their way into Cypress as a standard resolution.