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

cypress open yields "bad option: --project" #3254

Closed
IRCraziestTaxi opened this issue Jan 30, 2019 · 8 comments
Closed

cypress open yields "bad option: --project" #3254

IRCraziestTaxi opened this issue Jan 30, 2019 · 8 comments

Comments

@IRCraziestTaxi
Copy link

IRCraziestTaxi commented Jan 30, 2019

Current behavior:

Running the command cypress open yields output bad option: --project; cypress does not start.

Note also that I am not providing the --project flag; I do not know where that is coming from. I looked at the cypress and cypress.cmd files in node_modules, but I don't see it in there.

Note also that completely removing all traces of cypress from my system and doing npm install again (which in turns does a fresh install of cypress) fixes it, but I cannot do that every time I need to open cypress; it takes forever.

Desired behavior:

Running the command cypress open opens cypress.

Steps to reproduce: (app code and test code)

  1. Install cypress via npm.
  2. Run the command node_modules\\.bin\cypress open. (Cypress will open.)
  3. Close cypress. Maybe even reboot machine; I can't remember how far you need to go with it.
  4. Run the command node_modules\\.bin\cypress open. (Bad option output is yielded.)

Versions

Cypress package version: 3.1.0
Cypress binary version: 3.1.0

Edit for full disclosure of command and output:

C:\...\ProjectFolder>node_modules\.bin\cypress open
C:\Users\...\AppData\Local\Cypress\Cache\3.1.0\Cypress\Cypress.exe: bad option: --project
@IRCraziestTaxi
Copy link
Author

IRCraziestTaxi commented Jan 30, 2019

Update: re-installing always fixed it before, but now it blows up when running after re-installing.

C:\...\ProjectName>npm run cypress

> project-name@1.4.0 cypress C:\...\ProjectName
> cypress open

It looks like this is your first time using Cypress: 3.1.0

 ×  Verifying Cypress can run C:\Users\...\AppData\Local\Cypress\Cache\3.1.0\Cypress
   → Cypress Version: 3.1.0
Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.
----------

C:\Users\...\AppData\Local\Cypress\Cache\3.1.0\Cypress\Cypress.exe: bad option: --smoke-test
C:\Users\...AppData\Local\Cypress\Cache\3.1.0\Cypress\Cypress.exe: bad option: --ping=744
----------

Platform: win32 (10.0.17134)
Cypress Version: 3.1.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project-name@1.4.0 cypress: `cypress open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project-name@1.4.0 cypress script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\...\AppData\Roaming\npm-cache\_logs\2019-01-30T20_01_28_564Z-debug.log

I have blown cypress away and re-installed several times to no avail.

@jennifer-shehane
Copy link
Member

Hey @IRCraziestTaxi, what is the name of the root directory where you are running node_modules\\.bin\cypress open at? Also, do you have a node_module installed in your project called project-name? I can't track down where this package is coming from.

Is there a reason you are using version 3.1.0? We just released version 3.1.5 with lots of bug fixes.

@jennifer-shehane
Copy link
Member

Could you also open Cypress in debug mode mode and print the logs here?

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Jan 31, 2019
@IRCraziestTaxi
Copy link
Author

Thanks for the reply, @jennifer-shehane.

what is the name of the root directory where you are running node_modules\.bin\cypress open at?

I am running that command in the root folder of the project where the node_modules folder is located.

Also, do you have a node_module installed in your project called project-name?

No, ProjectName/project-name are what I replaced the actual name of the project using cypress with. So

> project-name@1.4.0 cypress C:\...\ProjectName
> cypress open

just means that cypress is running for my project, which I dubbed project-name for this discussion.

The only reason I was using 3.1.0 was because that is the version we have pinned in our package.json. I did try upgrading to 3.1.5, but the issue persists...

C:\...\ProjectName>npm install

> project-name@1.4.0 preinstall C:\...\ProjectName
> node tools/nodeVersionCheck.ts


> cypress@3.1.5 postinstall C:\...\ProjectName\node_modules\cypress
> node index.js --exec install

Installing Cypress (version: 3.1.5)

 √  Downloaded Cypress
 √  Unzipped Cypress
 √  Finished Installation C:\Users\...\AppData\Local\Cypress\Cache\3.1.5

You can now open Cypress by running: node_modules\.bin\cypress open

https://on.cypress.io/installing-cypress

... (npm warnings and stuff)

added 20 packages and removed 3 packages in 405.627s

C:\...\ProjectName>node_modules\.bin\cypress open
It looks like this is your first time using Cypress: 3.1.5

 ×  Verifying Cypress can run C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress
   → Cypress Version: 3.1.5
Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.
----------

C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress\Cypress.exe: bad option: --smoke-test
C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress\Cypress.exe: bad option: --ping=444
----------

Platform: win32 (10.0.17134)
Cypress Version: 3.1.5

I will give this debug mode thing a try... how does this work exactly? All the doc says is:

On Windows:
set DEBUG=cypress:*

Then what? Just run node_modules\.bin\cypress open again?

@jennifer-shehane
Copy link
Member

yes, you then run node_modules\.bin\cypress open again after set DEBUG like you mentioned.

@IRCraziestTaxi
Copy link
Author

Here is my output after setting debug:

C:\...\ProjectName>set DEBUG=cypress:*

C:\...\ProjectName>node_modules\.bin\cypress open
  cypress:cli cli starts with arguments ["C:\\Program Files\\nodejs\\node.exe","C:\\...\\ProjectName\\node_modules\\cypress\\bin\\cypress","open"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli program parsing arguments +17ms
  cypress:cli opening Cypress +4ms
  cypress:cli parsed cli options {} +287ms
  cypress:cli opening from options {"project":"C:\\...\\ProjectName"} +0ms
  cypress:cli command line arguments ["--project","C:\\...\\ProjectName"] +11ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +1ms
  cypress:cli checking if executable exists C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress\Cypress.exe +16ms
  cypress:cli Binary is executable? : true +13ms
  cypress:cli binaryDir is  C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress +1ms
  cypress:cli Reading binary package.json from: C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress\resources\app\package.json +0ms
  cypress:cli Found binary version 3.1.5 installed in: C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress +24ms
  cypress:cli could not read binary_state.json file +32ms
  cypress:cli {} +3ms
  cypress:cli is Verified ? undefined +13ms
  cypress:cli running binary verification check 3.1.5 +16ms
It looks like this is your first time using Cypress: 3.1.5

  cypress:cli clearing out the verified version +29ms
  cypress:cli running smoke test +9ms
  cypress:cli using Cypress executable C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress\Cypress.exe +9ms
  cypress:cli needs XVFB? false +8ms
  cypress:cli smoke test command: C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress\Cypress.exe --smoke-test --ping=727 +2ms
 \  Verifying Cypress can run C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress
  cypress:cli Smoke test failed: { Error: Command failed: C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress\Cypress.exe --smoke-test --ping=727
C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress\Cypress.exe: bad option: --smoke-test
C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress\Cypress.exe: bad option: --ping=727


    at makeError (C:\...\ProjectName\node_modules\execa\index.js:172:9)
    at Promise.all.then.arr (C:\...\ProjectName\node_modules\execa\index.js:277:16)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  code: 9,
  stdout: '',
  stderr: 'C:\\Users\\...\\AppData\\Local\\Cypress\\Cache\\3.1.5\\Cypress\\Cypress.exe: bad option: --smoke-test\r\nC:\\Users\\...\\AppData\\Local\\Cypress\\Cache\\3.1.5\\Cypress\\Cypress.exe: bad option: --ping=727\r\n',
  failed: true,
  signal: null,
  cmd: 'C:\\Users\\...\\AppData\\Local\\Cypress\\Cache\\3.1.5\\Cypress\\Cypress.exe --smoke-test --ping=727',
  timedOut: false,
 ×  Verifying Cypress can run C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress
   → Cypress Version: 3.1.5
Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.
----------

C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress\Cypress.exe: bad option: --smoke-test
C:\Users\...\AppData\Local\Cypress\Cache\3.1.5\Cypress\Cypress.exe: bad option: --ping=727
----------

Platform: win32 (10.0.17134)
Cypress Version: 3.1.5

@IRCraziestTaxi
Copy link
Author

Update: I tried a reboot again (after upgrading to 3.1.5) and that seems to have fixed it. Even after verifying I can open cypress and rebooting a second time, it now continues to open.

Maybe the upgrade to 3.1.5 did the trick? (And a reboot afterwards, obviously.)

Either way, I guess I'll go ahead and close this since it seems to have been an edge case solved by the good old "turning it off and back on". I will try to be careful when opening cypress and note the steps to reproduce the issue in case it comes up again.

@jennifer-shehane
Copy link
Member

In order to direct better focus on the overall problem that is being described in several issues - we opened one issue to track this behavior #4624 Please add any information about how we can reproduce this bug there. 🙏

@cypress-io cypress-io locked and limited conversation to collaborators Jul 1, 2019
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

2 participants