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

lighthouse CLI gives "Unexpected token" error on Ubuntu 20.04.1 #11854

Closed
alex4200 opened this issue Dec 18, 2020 · 4 comments
Closed

lighthouse CLI gives "Unexpected token" error on Ubuntu 20.04.1 #11854

alex4200 opened this issue Dec 18, 2020 · 4 comments

Comments

@alex4200
Copy link

Provide the steps to reproduce

  1. I installed lighthouse on Ubuntu Linux 20.04.1 as follows:
 sudo npm install -g lighthouse
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
/usr/local/bin/lighthouse -> /usr/local/lib/node_modules/lighthouse/lighthouse-cli/index.js
/usr/local/bin/chrome-debug -> /usr/local/lib/node_modules/lighthouse/lighthouse-core/scripts/manual-chrome-launcher.js
npm WARN notsup Unsupported engine for lighthouse@7.0.0: wanted: {"node":">=12.13.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: lighthouse@7.0.0
  1. Running lighthouse google.com results in the following error message:
    /usr/local/lib/node_modules/lighthouse/lighthouse-core/gather/driver.js:68
    _traceCategories = Driver.traceCategories;
    ^
SyntaxError: Unexpected token =
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/lighthouse/lighthouse-core/runner.js:9:16)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

What is the current behavior?

I get an error message

What is the expected behavior?

Command runs without error message.

Environment Information

  • Affected Channels: CLI
  • Lighthouse version: Unclear
  • Chrome version: 87.0.4280.66
  • Node.js version: v10.19.0
  • Operating System: Ubuntu 20.04.1

Related issues

@pdr
Copy link

pdr commented Dec 18, 2020

I think this could be your issue:
npm WARN notsup Unsupported engine for lighthouse@7.0.0: wanted: {"node":">=12.13.0"} (current: {"node":"10.19.0","npm":"6.14.4"})

@pdr
Copy link

pdr commented Dec 18, 2020

I ran into the same problem and upgrading to node 12 worked.

@alex4200
Copy link
Author

Thanks, upgrading to node 12 also fixed the issue on my side.
Upgrade guide for Ubuntu: HERE

@patrickhulce
Copy link
Collaborator

@pdr is right the v7 release just upgraded the minimum node version to 12 👍

4vanger added a commit to 4vanger/lighthouse-ci that referenced this issue Apr 5, 2021
Update Node version to 12 to avoid bug described in GoogleChrome/lighthouse#11854
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants