-
Notifications
You must be signed in to change notification settings - Fork 198
Open
Description
Hi. I tried using lighthouse-mcp on windows and it crashes when getting the result. The results are generated in a temporary folder but it crashes after "LH:status Generating results..."
Here is the last lines of the log with the stacktrace of the error:
2025-09-24 22:35:38.347 | [info] MCP [pid: 95860] stderr: Lighthouse MCP server running on stdio
2025-09-24T19:34:28.971Z LH:config:warn unrecognized category in 'onlyCategories': pwa
2025-09-24T19:34:29.048Z LH:status Connecting to browser
2025-09-24T19:34:29.053Z LH:status Navigating to about:blank
2025-09-24T19:34:29.057Z LH:status Benchmarking machine
2025-09-24T19:34:30.061Z LH:status Host device pixel ratio
2025-09-24T19:34:30.061Z LH:status Preparing target for navigation mode
2025-09-24T19:34:30.073Z LH:status Cleaning origin data
2025-09-24T19:34:30.084Z LH:status Cleaning browser cache
2025-09-24T19:34:30.118Z LH:status Preparing network conditions
2025-09-24T19:34:30.156Z LH:status Navigating to https:// - redacted -
2025-09-24T19:34:33.781Z LH:status Getting artifact: DevtoolsLog
2025-09-24T19:34:33.781Z LH:status Getting artifact: Trace
2025-09-24T19:34:33.781Z LH:status Getting artifact: Accessibility
2025-09-24T19:34:33.906Z LH:status Getting artifact: AnchorElements
2025-09-24T19:34:33.970Z LH:method <= browser ERR:error DOM.pushNodeByPathToFrontend
2025-09-24T19:34:33.971Z LH:method <= browser ERR:error DOM.pushNodeByPathToFrontend
..... a lot ......
2025-09-24T19:35:38.017Z LH:status Auditing: Optimize DOM size
2025-09-24T19:35:38.018Z LH:status Auditing: Duplicated JavaScript
2025-09-24T19:35:38.018Z LH:status Auditing: Font display
2025-09-24T19:35:38.019Z LH:status Auditing: Forced reflow
2025-09-24T19:35:38.019Z LH:status Auditing: Improve image delivery
2025-09-24T19:35:38.020Z LH:status Auditing: INP breakdown
2025-09-24T19:35:38.023Z LH:status Auditing: LCP breakdown
2025-09-24T19:35:38.024Z LH:status Auditing: LCP request discovery
2025-09-24T19:35:38.025Z LH:status Auditing: Legacy JavaScript
2025-09-24T19:35:38.025Z LH:status Auditing: Modern HTTP
2025-09-24T19:35:38.026Z LH:status Auditing: Network dependency tree
2025-09-24T19:35:38.026Z LH:status Auditing: Render blocking requests
2025-09-24T19:35:38.027Z LH:status Auditing: 3rd parties
2025-09-24T19:35:38.032Z LH:status Auditing: Optimize viewport for mobile
2025-09-24T19:35:38.032Z LH:status Generating results...
Lighthouse error: Error: EPERM, Permission denied: \\?\C:\Users\Andrei\AppData\Local\Temp\lighthouse.99380144 '\\?\C:\Users\Andrei\AppData\Local\Temp\lighthouse.99380144'
at rmSync (node:fs:1248:18)
at Launcher.destroyTmp (C:\Users\Andrei\AppData\Local\npm-cache\_npx\c0b21ac6fcf0b232\node_modules\chrome-launcher\dist\chrome-launcher.js:330:9)
at Launcher.kill (C:\Users\Andrei\AppData\Local\npm-cache\_npx\c0b21ac6fcf0b232\node_modules\chrome-launcher\dist\chrome-launcher.js:312:14)
at Object.kill (C:\Users\Andrei\AppData\Local\npm-cache\_npx\c0b21ac6fcf0b232\node_modules\chrome-launcher\dist\chrome-launcher.js:41:18)
at LighthouseServer.handleRunAudit (file:///C:/Users/Andrei/AppData/Local/npm-cache/_npx/c0b21ac6fcf0b232/node_modules/lighthouse-mcp/build/index.js:139:26) {
errno: 1,
code: 'EPERM',
path: '\\\\?\\C:\\Users\\Andrei\\AppData\\Local\\Temp\\lighthouse.99380144',
syscall: 'rm'
}
The error seems to come from Launcher.destroyTmp > rmSync
chrome-launcher/src/chrome-launcher.ts
Line 489 in 0323cc7
rmSync(this.userDataDir, {recursive: true, force: true, maxRetries: 10}); |
Lighthouse-mcp uses chromeLauncher like this:
https://github.com/priyankark/lighthouse-mcp/blob/9af89d05eb21d41f1008e8d2c96223d03fa2e9f5/src/index.ts#L160
const chrome = await chromeLauncher.launch({ chromeFlags: ['--headless'] });
I am providing chrome path environment variable because otherwise it says chrome not installed.
"CHROME_PATH": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
I tried fixing permissions but they are fine. I added Everyone
with full access.
matejchalk
Metadata
Metadata
Assignees
Labels
No labels