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 can't locate Chrome 85 exe in Windows #8425

Closed
tyler36 opened this issue Aug 27, 2020 · 12 comments · Fixed by #8449
Closed

Cypress can't locate Chrome 85 exe in Windows #8425

tyler36 opened this issue Aug 27, 2020 · 12 comments · Fixed by #8449
Assignees
Labels
browser: chrome good first issue Good for newcomers OS: windows pkg/launcher This is due to an issue in the packages/launcher directory

Comments

@tyler36
Copy link

tyler36 commented Aug 27, 2020

Current behavior:

cypress open does not show Chrome as a browser option. This occured after update to Chrome 85, released 2020-08-25.

I'm pretty sure this comes down to how Cypress is checking for the browser. While debugging, I came across a claim that cypress uses the following line to detect Chrome:

wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value

If this is true, Cypress won't work with Chrome 85 because it defaults to a x64 version (at least on my PC) which has a different default directory on Win10 x64 version:

C:\Program Files\Google\Chrome\Application\Chrome.exe

Desired behavior:

I would like the ability to use Chrome 84 x64 as a browser.

Test code to reproduce

cypress open

Versions

OS: Windows 10
Cypress: 4.9.0 and 5.0.0

@jennifer-shehane
Copy link
Member

Could you run Cypress in debug mode specifically logging cypress:launcher logs and run cypress info and print the entire set of logs here?

@tyler36
Copy link
Author

tyler36 commented Aug 27, 2020

I ran

set DEBUG=cypress:*
cypress run

you will see a LOT of messages when running with DEBUG=... setting
I see no specific debug info in the console. Just the test runner information, time taken and finished.

 Cypress:    5.0.0                                                                              │
  │ Browser:    Electron 83 (headless)                                                             │
  │ Specs:      1 found (examples\window.spec.js)
...
  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ √  examples\window.spec.js                  00:27        3        3        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    √  All specs passed!                        00:27        3        3        -        -        -

@tyler36
Copy link
Author

tyler36 commented Aug 27, 2020

Displaying Cypress info...

Detected 2 browsers installed:

1. Edge
  - Name: edge
  - Channel: stable
  - Version: 84.0.522.63
  - Executable: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
  - Profile: C:\Users\xxx\AppData\Roaming\Cypress\cy\production\browsers\edge-stable

2. Firefox
  - Name: firefox
  - Channel: stable
  - Version: 79.0.0.7506
  - Executable: C:\Program Files\Mozilla Firefox\firefox.exe
  - Profile: C:\Users\xxx\AppData\Roaming\Cypress\cy\production\browsers\firefox-stable

Note: to run these browsers, pass <name>:<channel> to the '--browser' field

Examples:
- cypress run --browser firefox
- cypress run --browser edge

Learn More: https://on.cypress.io/launching-browsers

Proxy Settings: none detected
Environment Variables: none detected

Application Data: C:\Users\xxx\AppData\Roaming\cypress\cy\development
Browser Profiles: C:\Users\xxx\AppData\Roaming\cypress\cy\development\browsers
Binary Caches: C:\Users\xxx\AppData\Local\Cypress\Cache

Cypress Version: 5.0.0
System Platform: win32 (10.0.18363)
System Memory: 8.46 GB free 1.42 GB

@jennifer-shehane
Copy link
Member

Run:

set DEBUG=cypress:launcher
cypress run

@tyler36
Copy link
Author

tyler36 commented Aug 27, 2020

❯ set DEBUG=cypress:launcher
❯ cypress run


====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:    5.0.0                                                                              │
  │ Browser:    Electron 83 (headless)                                                             │
  │ Specs:      1 found (examples\window.spec.js)                                                  │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────

  Running:  examples\window.spec.js                                                         (1 of 1)


  Window
    √ cy.window() - get the global window object (9487ms)
    √ cy.document() - get the document object (12482ms)
    √ cy.title() - get the title (10776ms)


  3 passing (44s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        3                                                                                │
  │ Passing:      3                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     44 seconds                                                                       │
  │ Spec Ran:     examples\window.spec.js                                                          │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF
    Compression progress:  83%
  -  Finished processing: I:\code\temp\cypress\cypress\videos\examples\window.spec.js   (11 seconds)
                          .mp4


====================================================================================================

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ √  examples\window.spec.js                  00:44        3        3        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    √  All specs passed!                        00:44        3        3        -        -        -  

@jennifer-shehane
Copy link
Member

Yah, your debug logs aren't logging for some reason. 😞 I've seen this occur with permissions issues with setting the environment variable in the terminal/shell. You may need to run your terminal in administrative mode or review your permission settings.

@LaurensLeeuwis
Copy link

(I didn't get debug logging either, but running export DEBUG=cypress:launcher instead of set DEBUG=cypress:launcher did the trick for me)

@LukeBalsiger
Copy link

LukeBalsiger commented Aug 27, 2020

We are having the same issue since chrome 85 on a ci machine. Here's the output from our log
cypress-launcher-log.txt


cypress:launcher detecting if the following browsers are present [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', versionRegex: /Google Chrome (\S+)/m, binary: [ 'google-chrome', 'chrome', 'google-chrome-stable' ] }, { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', versionRegex: /Chromium (\S+)/m, binary: [ 'chromium-browser', 'chromium' ] }, { name: 'chrome', family: 'chromium', channel: 'canary', displayName: 'Canary', versionRegex: /Google Chrome Canary (\S+)/m, binary: 'google-chrome-canary' }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', versionRegex: /^Mozilla Firefox ([^\sab]+)$/m, binary: 'firefox' }, { name: 'firefox', family: 'firefox', channel: 'dev', displayName: 'Firefox Developer Edition', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', versionRegex: /^Mozilla Firefox (\S+b\S*)$/m, binary: [ 'firefox-developer-edition', 'firefox' ] }, { name: 'firefox', family: 'firefox', channel: 'nightly', displayName: 'Firefox Nightly', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', versionRegex: /^Mozilla Firefox (\S+a\S*)$/m, binary: [ 'firefox-nightly', 'firefox-trunk' ] }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', versionRegex: /Microsoft Edge (\S+)/m, binary: 'edge' }, { name: 'edge', family: 'chromium', channel: 'canary', displayName: 'Edge Canary', versionRegex: /Microsoft Edge Canary (\S+)/m, binary: 'edge-canary' }, { name: 'edge', family: 'chromium', channel: 'beta', displayName: 'Edge Beta', versionRegex: /Microsoft Edge Beta (\S+)/m, binary: 'edge-beta' }, { name: 'edge', family: 'chromium', channel: 'dev', displayName: 'Edge Dev', versionRegex: /Microsoft Edge Dev (\S+)/m, binary: 'edge-dev' } ]
cypress:launcher checking one browser chrome
cypress:launcher looking up chrome on win32 platform
cypress:launcher looking at possible paths... { browser: { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', versionRegex: /Google Chrome (\S+)/m, binary: [ 'google-chrome', 'chrome', 'google-chrome-stable' ] }, exePaths: [ 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe' ] }
cypress:launcher found C:\Program Files (x86)\Google\Chrome\Application\chrome.exe ? false
cypress:launcher error while looking up exe, trying next exePath { exePath: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', exePaths: [], err: Error: Browser not installed: chrome at Object.exports.notInstalledErr (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\errors.js:4:15) at C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:124:32 at step (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:32:23) at Object.next (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:13:53) at C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:7:71 at new Promise (<anonymous>:null:null) at __awaiter (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:3:12) at tryNextExePath (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:118:47) at C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:130:32 { notInstalled: true } }
cypress:launcher browser chrome not installed
cypress:launcher checking one browser chromium
cypress:launcher looking up chromium on win32 platform
cypress:launcher looking at possible paths... { browser: { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', versionRegex: /Chromium (\S+)/m, binary: [ 'chromium-browser', 'chromium' ] }, exePaths: [ 'C:\\Program Files (x86)\\Google\\chrome-win32\\chrome.exe' ] }
cypress:launcher found C:\Program Files (x86)\Google\chrome-win32\chrome.exe ? false
cypress:launcher error while looking up exe, trying next exePath { exePath: 'C:\\Program Files (x86)\\Google\\chrome-win32\\chrome.exe', exePaths: [], err: Error: Browser not installed: chromium at Object.exports.notInstalledErr (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\errors.js:4:15) at C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:124:32 at step (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:32:23) at Object.next (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:13:53) at C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:7:71 at new Promise (<anonymous>:null:null) at __awaiter (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:3:12) at tryNextExePath (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:118:47) at C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:130:32 { notInstalled: true } }
cypress:launcher browser chromium not installed
cypress:launcher checking one browser chrome
cypress:launcher looking up chrome on win32 platform
cypress:launcher looking at possible paths... { browser: { name: 'chrome', family: 'chromium', channel: 'canary', displayName: 'Canary', versionRegex: /Google Chrome Canary (\S+)/m, binary: 'google-chrome-canary' }, exePaths: [ 'C:\\Users\\BuildLabTestFPTAX3FD\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe' ] }
cypress:launcher found C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Google\Chrome SxS\Application\chrome.exe ? false
cypress:launcher error while looking up exe, trying next exePath { exePath: 'C:\\Users\\BuildLabTestFPTAX3FD\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe', exePaths: [], err: Error: Browser not installed: chrome at Object.exports.notInstalledErr (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\errors.js:4:15) at C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:124:32 at step (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:32:23) at Object.next (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:13:53) at C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:7:71 at new Promise (<anonymous>:null:null) at __awaiter (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:3:12) at tryNextExePath (C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:118:47) at C:\Users\BuildLabTestFPTAX3FD\AppData\Local\Cypress\Cache\4.12.1\Cypress\resources\app\packages\launcher\lib\windows\index.js:130:32 { notInstalled: true } }
cypress:launcher browser chrome not installed

@tyler36
Copy link
Author

tyler36 commented Aug 28, 2020

As stated in the original post, Chrome 85 uses a different default installation directory.
Solution: Create a symlink. Powershell example below:

New-Item -ItemType SymbolicLink -Path "C:\Program Files (x86)\Google\Chrome" -Target "C:\Program Files\Google\Chrome"

The site documentation does mension this but the original post was intended a problem for Chrome uses on Windows. If Google has defaulted to x64 version for Windows users, documentation should be updated to reflect this. Better yet, Cypress should be updated to look to this path for Windows x64 users.

@jennifer-shehane
Copy link
Member

The code for the locations of browsers on Windows can be found here: https://github.com/cypress-io/cypress/blob/develop/packages/launcher/lib/windows/index.ts#L11:L11

We're open to a pull request to fix the executable location in Windows.

@jennifer-shehane jennifer-shehane changed the title Can't see Chrome 85 Cypress can't locate Chrome 85 exe in Windows Aug 28, 2020
@cypress-bot cypress-bot bot added stage: ready for work The issue is reproducible and in scope and removed stage: needs information Not enough info to reproduce the issue labels Aug 28, 2020
@jennifer-shehane jennifer-shehane added good first issue Good for newcomers pkg/launcher This is due to an issue in the packages/launcher directory labels Aug 28, 2020
@flotwig flotwig self-assigned this Aug 31, 2020
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope stage: work in progress labels Aug 31, 2020
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Aug 31, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 31, 2020

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

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 1, 2020

Released in 5.1.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v5.1.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
browser: chrome good first issue Good for newcomers OS: windows pkg/launcher This is due to an issue in the packages/launcher directory
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants