Lighthouse-ci: CLI fails with spawn unknown error on Windows

Created on 12 Nov 2019  ·  2Comments  ·  Source: GoogleChrome/lighthouse-ci

Firstly: this is a great project and I'm really excited to use it. Thanks for all the hard work!

In https://github.com/GoogleChrome/lighthouse-ci/blob/master/docs/cli.md#overview it says "Install the CLI globally to try it out locally", but on Windows the run ends with an spawn UNKNOWN error:

✅  .lighthouseci/ directory writable
⚠️   Configuration file found
Healthcheck passed!

Automatically determined ./dist as `staticDistDir`.
Set it explicitly in lighthouserc.json if incorrect.

Started a web server on port 6146...
Running Lighthouse 3 time(s) on http://localhost:6146/404.html
Run #1...failed!
Error: spawn UNKNOWN
    at ChildProcess.spawn (internal/child_process.js:394:11)
    at Object.spawn (child_process.js:540:9)
    at LighthouseRunner.run (C:\Users\Rhian\AppData\Roaming\npm\node_modules\@lhci\cli\src\collect\lighthouse-runner.js:83:34)

This looks to be because childProcess.spawn() in lighthouse-runner.js is called without a third argument { shell: true }, which is required on Windows.

Since this is a CI tool and was probably never intended to be run on Windows, perhaps the only change needed is to mention this in the CLI documentation that I linked above. It would be useful to be able to do dry runs locally, though.

P1 bug

Most helpful comment

Thanks so much for filing @escherina!

Since this is a CI tool and was probably never intended to be run on Windows, perhaps the only change needed is to mention this in the CLI documentation that I linked above. It would be useful to be able to do dry runs locally, though.

Great point we didn't consider the dry run case, and I'm sure some folks will want to run on windows CI machines in the future, so I'm sold! 👍

All 2 comments

Thanks so much for filing @escherina!

Since this is a CI tool and was probably never intended to be run on Windows, perhaps the only change needed is to mention this in the CLI documentation that I linked above. It would be useful to be able to do dry runs locally, though.

Great point we didn't consider the dry run case, and I'm sure some folks will want to run on windows CI machines in the future, so I'm sold! 👍

should be fixed by #79 🎉

Was this page helpful?
0 / 5 - 0 ratings