GoogleChrome/lighthouse · error

No audit provided\nUsage: $0 <lhr directory> <audit id>

Error message

No audit provided\nUsage: $0 <lhr directory> <audit id>

What it means

Error "No audit provided\nUsage: $0 <lhr directory> <audit id>" thrown in GoogleChrome/lighthouse.

Source

Thrown at core/scripts/gcp-collection/analyze-lhr-data.js:23

 * 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: [],
  };
  for (const run of runs) {

View on GitHub (pinned to 9515cd4e58)

Solutions

  1. Pass the audit id as the second 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 audit id argument.

Common situations: See trigger scenarios.


AI-assisted analysis of GoogleChrome/lighthouse@9515cd4e58 (2026-08-13). Data as JSON: /api/errors/990841586783c7cf. Report an issue: GitHub.