User wants to automatically analyze a website URL for performance metrics, accessibility, SEO, or best practices without manual Chrome DevTools interaction.
node --version && npm list lighthouse chrome-launchernode automation-script.js [--mobile] [--output=DIR] to collect all metrics.audit-checklist.md and metrics-reference.md../results/. Ask user before saving to memory for tracking.troubleshooting.md for common solutions (Chrome not found, ES module errors, memory issues).| Topic | File |
|---|---|
| ------- | ------ |
| Automation script | automation-script.js |
| Metrics & thresholds | metrics-reference.md |
| Fix checklists | audit-checklist.md |
| Setup guide | setup.md |
| Quick start | quick-start.md |
| Troubleshooting | troubleshooting.md |
| Memory tracking | memory-template.md |
After analysis, offer to save: URL, timestamp, scores, critical issues, report path. Always ask before saving to memory.
# Quick audit (desktop)
node automation-script.js https://example.com
# Mobile emulation
node automation-script.js https://example.com --mobile
# Custom output directory
node automation-script.js https://example.com --output=./reports
# Lighthouse CLI directly
lighthouse https://example.com --output=json --output-path=report.json
| Error | Solution |
|---|---|
| ------- | ---------- |
| "lighthouse is not a function" | Add "type": "module" to package.json |
| "Chrome not found" | Install Chrome or use npm install puppeteer |
| "JavaScript heap out of memory" | Run with node --max-old-space-size=4096 |
| "Port already in use" | Specify different port in script config |
共 1 个版本