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

Developing on windows has a broken workflow (or contributing instructions incorrect) #8783

Closed
lukeapage opened this issue Oct 8, 2020 · 4 comments · Fixed by #15492
Closed
Labels
OS: windows process: contributing Related to contributing to the Cypress codebase type: chore Work is required w/ no deliverable to end user

Comments

@lukeapage
Copy link
Contributor

lukeapage commented Oct 8, 2020

Current behavior

I'm running windows and git bash.
I've followed the contributing instructions and set script-shell to git bash also.
The install completes without errors but yarn start:

MINGW64 /c/git/cypress (develop)
$ yarn
yarn install v1.22.0
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ ./scripts/run-if-not-ci.sh yarn build
Done in 3.05s.

MINGW64 /c/git/cypress (develop)
$ yarn start
yarn run v1.22.0
$ yarn ensure-deps
$ ./scripts/ensure-dependencies.sh
warning Integrity check: Top level patterns don't match
error Integrity check failed
error Found 1 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.
Your dependencies are out of date; installing the correct dependencies...
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ ./scripts/run-if-not-ci.sh yarn build
$ node $(yarn bin cypress) open --dev --global
C:\git\cypress\node_modules\.bin\cypress:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at wrapSafe (internal/modules/cjs/loader.js:1071:16)
    at Module._compile (internal/modules/cjs/loader.js:1121:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
    at Module.load (internal/modules/cjs/loader.js:1001:32)
    at Function.Module._load (internal/modules/cjs/loader.js:900:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I changed the package.json start command to yarn cypress open --dev --global
and it fails:

$ yarn start
yarn run v1.22.0
$ yarn ensure-deps
$ ./scripts/ensure-dependencies.sh
warning Integrity check: Top level patterns don't match
error Integrity check failed
error Found 1 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.
Your dependencies are out of date; installing the correct dependencies...
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ ./scripts/run-if-not-ci.sh yarn build
$ yarn cypress open --dev --global
$ C:\git\cypress\node_modules\.bin\cypress open --dev --global
/usr/bin/bash: C:gitcypressnode_modules.bincypress: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I now removed the script-shell config - now it succeeds and opens but its an empty project - I thought it would show the cypress spec files?

I also tried with the original yarn start command and no script-shell set - that fails too:

$ yarn start
yarn run v1.22.0
$ yarn ensure-deps
$ ./scripts/ensure-dependencies.sh
$ node $(yarn bin cypress) open --dev --global
internal/modules/cjs/loader.js:984
  throw err;
  ^

Error: Cannot find module 'C:\git\cypress\$(yarn'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:981:15)
    at Function.Module._load (internal/modules/cjs/loader.js:863:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I resolved it in the end by having yarn start be cypress open --dev --global and then selecting the package I want to test and not setting script-shell

@jennifer-shehane jennifer-shehane added type: chore Work is required w/ no deliverable to end user process: contributing Related to contributing to the Cypress codebase OS: windows labels Oct 8, 2020
@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Oct 8, 2020
@flotwig
Copy link
Contributor

flotwig commented Oct 9, 2020

Also running into this on Windows. I can open Cypress via node ./scripts/cypress.js open, but not via yarn cypress:open, I get the same error as OP #3.

@sainthkh
Copy link
Contributor

sainthkh commented Nov 9, 2020

It didn't happen to me on Windows with 5.5.0. I can run Cypress with yarn cypress:open inside packages/driver folder.

@lukeapage
Copy link
Contributor Author

I was running from the root folder

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 16, 2021

The code for this is done in cypress-io/cypress#15492, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: windows process: contributing Related to contributing to the Cypress codebase type: chore Work is required w/ no deliverable to end user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants