cypress: Cypress can't find Chrome after update to 3.3.0

Current behavior:

After upgrading to 3.3.0, Cypress is unable to use the existing Chrome installation it used prior. In addition, now even after uninstalling/reinstalling several times both Cypress and Chrome, I can’t get Chrome to be available anymore.

image

When trying to clear the app data from the GUI:

{ Error: spawn cmd ENOENT
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs:
   [ '/c',
     'start',
     '""',
     '/wait',
     'C:\\Users\\James\\AppData\\Roaming\\Cypress\\cy\\production' ] }
Error: spawn cmd ENOENT
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

DEBUG logs: https://pastebin.com/u6kLMHZ0 ^this is the piece that worries me, since the logs seem to indicate that Cypress found Chrome, but doesn’t have it available for execution.

additional info: https://stackoverflow.com/questions/56224598/how-do-i-get-cypress-to-detect-my-existing-chrome-browser-after-upgrade

Desired behavior:

Cypress is able to use the existing Chrome application for execution, and is available in the dropdown menu in the GUI

Steps to reproduce: (app code and test code)

Windows 10 Cypress 3.2.0 Chrome installed in the correct location

  1. Upgrade using npm i cypress --save-dev
  2. Open cypress
  3. Look for Chrome to be now missing in the dropdown

Versions

Cypress 3.2.0 Cypress 3.3.0 Windows 10 Chrome 74

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (7 by maintainers)

Most upvoted comments

Hmm, looks similar to #3891.

Cypress uses WMIC.exe to look up info about a potential browser. If it can’t be launched, browser detection is broken.

It looks like WMIC.exe isn’t in your PATH. If you do echo $env:PATH, do you see C:\Windows\System32\Wbem? If not, add it:

setx PATH "$env:PATH;C:\Windows\System32\Wbem"

…and then restart VS code to pick up the new system-wide PATH. Check that echo $env:PATH shows the Wbem directory at the end, and then re-launch Cypress. Browser detection should work.


Environment variables on Windows are weird, you can obtain debug logs by using the cross-env package:

npm i -g cross-env
cross-env DEBUG=cypress:* npx cypress open
setx PATH "$env:PATH;C:\Windows\System32\Wbem"

Warning to all: I ran this command and it deleted everything else in my PATH. Now I have to rewrite it from scratch.

Thanks for the bug report. Does this work for you in 3.2.0?