Lighthouse: Incorrect and confusing CHROME_PATH error occurring when CHROME_PATH is not set

Created on 25 Sep 2018  路  11Comments  路  Source: GoogleChrome/lighthouse

Provide the steps to reproduce

  1. Run which chromium-browser to ensure chromium-browser is installed:
    /usr/bin/chromium-browser
  2. Run echo $CHROME_PATH to ensure it is NOT set:
  3. Run chromium-browser --product-version to ensure installed version is at least 66 (as per https://github.com/GoogleChrome/lighthouse/blob/52826e5536517453c154e8870ce2868f9222a991/lighthouse-cli/cli-flags.js#L93 ):
    69.0.3497.81
  4. Run lighthouse --version to ensure latest version:
    3.1.1
  5. Run lighthouse --quiet --no-update-notifier --no-enable-error-reporting --output=json --chrome-flags="--headless" https://**** replace **** with any site.

What is the current behavior?

Displays the following error:

Runtime error encountered: The environment variable CHROME_PATH must be set to executable of a build of Chromium version 54.0 or later.
Error
    at new LauncherError (/opt/pagespeed/node_modules/chrome-launcher/dist/utils.js:35:22)
    at new ChromePathNotSetError (/opt/pagespeed/node_modules/chrome-launcher/dist/utils.js:42:9)
    at Object.linux (/opt/pagespeed/node_modules/chrome-launcher/dist/chrome-finder.js:108:15)
    at Launcher.<anonymous> (/opt/pagespeed/node_modules/chrome-launcher/dist/chrome-launcher.js:143:80)
    at Generator.next (<anonymous>)
    at /opt/pagespeed/node_modules/chrome-launcher/dist/chrome-launcher.js:12:71
    at new Promise (<anonymous>)
    at __awaiter (/opt/pagespeed/node_modules/chrome-launcher/dist/chrome-launcher.js:8:12)
    at Launcher.launch (/opt/pagespeed/node_modules/chrome-launcher/dist/chrome-launcher.js:131:16)
    at Object.<anonymous> (/opt/pagespeed/node_modules/chrome-launcher/dist/chrome-launcher.js:52:24)

What is the expected behavior?

Lighthouse should find the chromium-browser from the PATH, and run the request. I just upgraded from 3.0.1 to 3.1.1 and it was working prior to my upgrade.

NOTE: If I replace the command with CHROME_PATH=/usr/bin/chromium-browser lighthouse --quiet --no-update-notifier --no-enable-error-reporting --output=json --chrome-flags="--headless" https://**** it works perfectly, but I'd like to avoid this if possible.

Environment Information

  • Affected Channels: CLI (didn't test other channels)
  • Lighthouse version: 3.1.1
  • Node.js version: 10.11.0
  • Operating System: Ubuntu Server 18.04.1 LTS

Related issues

bug pending-close

Most helpful comment

@klick-barakgall yes, we will release it when it's a bit more battle tested. I checked it in docker. I'm installing ubuntu as we speak to get it validated too.

The message is small todo which I can handle in a separate PR. Thanks for pointing out. I'll keep you updated.

All 11 comments

sorry my mistake, a fix is currently up https://github.com/GoogleChrome/chrome-launcher/pull/125

@wardpeet I can't test the fix on my setup, however any idea roughly when that might make it to the stable channel?

Additionally I forgot to point it out in the this issue but the docs seem to indicate a requirement of chrome 66+, but the error message states 54+. I don't know if your fix addresses this, but might be worth investigating separately. Thoughts?

@klick-barakgall yes, we will release it when it's a bit more battle tested. I checked it in docker. I'm installing ubuntu as we speak to get it validated too.

The message is small todo which I can handle in a separate PR. Thanks for pointing out. I'll keep you updated.

@wardpeet thanks man. You're awesome!

@klick-barakgall it works again in the latest lighthouse version. I tested it on ubuntu 18 lts. I did a new lighthouse install. Could you try it yourself to verify.

Yo @wardpeet I'm afraid I'm not that familiar with the lighthouse release schedule. When you say latest I don't think you mean the last release, as I don't see any new release. How can I install the "latest" to test it?

no worries we actually did not release lighthouse but we bumped chrome-launcher which is a dependency of lighthouse that is used to launch chrome.

it's bumped to 0.10.5. by doing rm -rf node_modules/chrome-launcher;npm install chrome-launcher you should get a new copy of the chrome-launcher. To validate you're on the latest chrome-launcher you can type grep "version" ./node_modules/chrome-launcher/package.json it should say version 0.10.5.

@wardpeet all good, works now.

Thank you!

guys, I still have an issue with this chrome_path. I try to use it in a docker container under jenkins, so using the node-alpine 8, assigning my container which contains the chromium, and chromium-browser, and it always shows the error. Locally everything works well.

Could you give us some repro steps please :)

Still getting the same error

(node:4255) UnhandledPromiseRejectionWarning: Error at new LauncherError (/var/www/node_modules/chrome-launcher/dist/utils.js:35:22) at new ChromePathNotSetError (/var/www/node_modules/chrome-launcher/dist/utils.js:42:9) at Object.linux (/var/www/node_modules/chrome-launcher/dist/chrome-finder.js:108:15) at Launcher.<anonymous> (/var/www/node_modules/chrome-launcher/dist/chrome-launcher.js:143:80) at Generator.next (<anonymous>) at /var/www/node_modules/chrome-launcher/dist/chrome-launcher.js:12:71 at new Promise (<anonymous>) at __awaiter (/var/www/node_modules/chrome-launcher/dist/chrome-launcher.js:8:12) at Launcher.launch (/var/www/node_modules/chrome-launcher/dist/chrome-launcher.js:131:16) at Object.<anonymous> (/var/www/node_modules/chrome-launcher/dist/chrome-launcher.js:52:24)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shellscape picture shellscape  路  3Comments

timj2 picture timj2  路  3Comments

codepodu picture codepodu  路  3Comments

mbparvezme picture mbparvezme  路  3Comments

workjalexanderfox picture workjalexanderfox  路  3Comments