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

Error "Runtime error encountered: No Chrome installations found." #214

Open
pcgeek86 opened this issue Aug 17, 2020 · 4 comments · May be fixed by #218
Open

Error "Runtime error encountered: No Chrome installations found." #214

pcgeek86 opened this issue Aug 17, 2020 · 4 comments · May be fixed by #218

Comments

@pcgeek86
Copy link

Summary

On Windows 10, I use the Scoop package manager to install Chromium, Google Chrome, and Node.js. When I run chrome.exe from a PowerShell terminal, it launches Chromium 84, which includes lighthouse in the DevTools.

When I run lighthouse CLI, I received an error stating Runtime error encountered: No Chrome installations found.

It seems that something in how lighthouse CLI searches for Chrome installations is borked?

Provide the steps to reproduce

npm install --global lighthouse
lighthouse trevorsullivan.net

What is the current behavior?

[cbt] C:\Users\TrevorSullivan\git> lighthouse.cmd trevorsullivan.net
Runtime error encountered: No Chrome installations found.
Error
    at new LauncherError (C:\Users\TrevorSullivan\scoop\persist\nodejs\bin\node_modules\lighthouse\node_modules\chrome-launcher\dist\utils.js:37:22)
    at new ChromeNotInstalledError (C:\Users\TrevorSullivan\scoop\persist\nodejs\bin\node_modules\lighthouse\node_modules\chrome-launcher\dist\utils.js:68:9)
    at Launcher.<anonymous> (C:\Users\TrevorSullivan\scoop\persist\nodejs\bin\node_modules\lighthouse\node_modules\chrome-launcher\dist\chrome-launcher.js:170:27)
    at Generator.next (<anonymous>)
    at C:\Users\TrevorSullivan\scoop\persist\nodejs\bin\node_modules\lighthouse\node_modules\chrome-launcher\dist\chrome-launcher.js:13:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\TrevorSullivan\scoop\persist\nodejs\bin\node_modules\lighthouse\node_modules\chrome-launcher\dist\chrome-launcher.js:9:12)
    at Launcher.launch (C:\Users\TrevorSullivan\scoop\persist\nodejs\bin\node_modules\lighthouse\node_modules\chrome-launcher\dist\chrome-launcher.js:156:16)
    at Object.<anonymous> (C:\Users\TrevorSullivan\scoop\persist\nodejs\bin\node_modules\lighthouse\node_modules\chrome-launcher\dist\chrome-launcher.js:48:24)
    at Generator.next (<anonymous>)

What is the expected behavior?

lighthouse runs successfully

Environment Information

  • Affected Channels: CLI
  • Lighthouse version: 6.2.0
  • Chrome version: chrome.exe points to Chromium 84.0.4147.125 (Official Build) (64-bit)
  • Node.js version: v14.8.0
  • Operating System: Windows 10 version 2004

Related issues

GoogleChrome/lighthouse#847

@patrickhulce patrickhulce transferred this issue from GoogleChrome/lighthouse Aug 17, 2020
@patrickhulce
Copy link
Collaborator

Thanks for filing @pcgeek86! As a general rule we won't be able to resolve every Chrome installation which is why the CHROME_PATH environment variable exists.

If this is a pretty common installation pattern though we'd gladly accept a PR to add it to our list of automatic checks :)

@deliverymanager
Copy link

I have the same problem!
On windows 10 even if the chrome was just installed, the module do not find it.

@pcgeek86
Copy link
Author

pcgeek86 commented Oct 1, 2020

Thanks for mentioning the CHROME_PATH environment variable. I didn't know about that.

Here's a simple work-around, using PowerShell to set the environment variable. This assumes that Google Chrome is already running on your system.

$env:CHROME_PATH = (Get-Process -Name chrome)[0].Path
lighthouse https://trevorsullivan.net

@magneticflux-
Copy link

Can it just check the existing %PATH% variable? Scoop (and others I'm sure) install binary shims so chrome.exe is just on the path.

Scoop Chromium's path:

|> ~ > Get-Command chrome.exe

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     chrome.exe                                         0.0.0.0    C:\Users\Mitchell\scoop\shims\chrome.exe

@magneticflux- magneticflux- linked a pull request Oct 31, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants