Cypress 5.0 - 无法找到已安装的浏览器

jpr*_*ism 5 cypress

我安装了 Cypress 5.0 并拥有所有浏览器 - Chrome、Edge 和 FF。当我跑

> npx cypress open
Run Code Online (Sandbox Code Playgroud)

无法看到右上角的所有浏览器。只有电子显示

我试过

> npx cypress open --browser chrome
Run Code Online (Sandbox Code Playgroud)

我收到以下错误

Can't run because you've entered an invalid browser name.                         
                                                                                  
Browser: 'chrome' was not found on your system or is not supported by Cypress.    
                                                                                  
Cypress supports the following browsers:                                          
- chrome                                                                          
- chromium                                                                        
- edge                                                                            
- electron                                                                        
- firefox (Cypress support in beta)                                               
                                                                                  
You can also use a custom browser: https://on.cypress.io/customize-browsers       
                                                                                  
Available browsers found on your system are:                                      
- electron                                                                        
                                                                              
Run Code Online (Sandbox Code Playgroud)

我也试过

> npx cypress open --browser C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
Run Code Online (Sandbox Code Playgroud)

Cypress 显示错误 - 我们无法在您提供的路径中识别已知浏览器

我的另一台机器,我可以从一开始就看到所有浏览器。

任何帮助将不胜感激

小智 0

我在 Jenkins 上遇到了同样的问题,只需添加C:\\Windows\\System32\\wbem到我的PATH管道脚本中(在 参考资料withEnv部分)即可解决它。