GoogleChrome/lighthouse · error
No directory provided\nUsage: $0 <lhr directory> <audit id>
Error message
No directory provided\nUsage: $0 <lhr directory> <audit id>
What it means
Error "No directory provided\nUsage: $0 <lhr directory> <audit id>" thrown in GoogleChrome/lighthouse.
Source
Thrown at core/scripts/gcp-collection/analyze-lhr-data.js:21
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview This script takes the directory (of extracted batch LHR data) along with an audit id and generates
* a JSON file with aggregated data for that audit.
*
* USAGE: node core/scripts/gcp-collection/analyze-lhr-data.js [<directory of lhr data>] [<audit id>]
*/
import {readdirSync, readFileSync} from 'fs';
import {join} from 'path';
const directory = process.argv[2];
const audit = process.argv[3];
if (!directory) throw new Error('No directory provided\nUsage: $0 <lhr directory> <audit id>');
if (!audit) throw new Error('No audit provided\nUsage: $0 <lhr directory> <audit id>');
const urlDirs = readdirSync(directory, {withFileTypes: true})
.filter(dirent => dirent.isDirectory());
const passSet = new Set();
const failSet = new Set();
const runResults = [];
for (const dir of urlDirs) {
const url = dir.name;
const path = join(directory, url);
const runs = readdirSync(path, {withFileTypes: true});
const entry = {
url,
/** @type {Array<any>} */
runs: [],View on GitHub (pinned to 9515cd4e58)
Solutions
- Pass the LHR directory as the first argument: node analyze-lhr-data.js <lhr directory> <audit id>.
When it happens
Trigger: Raised when the analyze-lhr-data script is invoked without the LHR directory argument.
Common situations: See trigger scenarios.
AI-assisted analysis of GoogleChrome/lighthouse@9515cd4e58 (2026-08-13).
Data as JSON: /api/errors/dcf88f90d4fa5d39.
Report an issue: GitHub.