GoogleChrome/lighthouse · error · Error

Unable to locate `${moduleIdentifier}`. Tried to resolv

Error message

Unable to locate `${moduleIdentifier}`.
     Tried to resolve the module from these locations:
       ${getModuleDirectory(import.meta)}
       ${cwdPath}

What it means

Error "Unable to locate `${moduleIdentifier}`. Tried to resolve the module from these locations: ${getModuleDirectory(import.meta)} ${cwdPath}" thrown in GoogleChrome/lighthouse.

Source

Thrown at core/config/config-helpers.js:520

  } catch (e) {}

  // 3.
  // See if the module resolves relative to the current working directory.
  // Most useful to handle the case of invoking Lighthouse as a module, since
  // then the config is an object and so has no path.
  const cwdPath = path.resolve(process.cwd(), moduleIdentifier);
  try {
    return require.resolve(cwdPath);
  } catch (e) {}

  const errorString = 'Unable to locate ' + (category ? `${category}: ` : '') +
    `\`${moduleIdentifier}\`.
     Tried to resolve the module from these locations:
       ${getModuleDirectory(import.meta)}
       ${cwdPath}`;

  if (!configDir) {
    throw new Error(errorString);
  }

  // 4.
  // Try looking up relative to the config file path. Just like the
  // relative path passed to `require()` is found relative to the file it's
  // in, this allows module paths to be specified relative to the config file.
  const relativePath = path.resolve(configDir, moduleIdentifier);
  try {
    return require.resolve(relativePath);
  } catch (requireError) {}

  // 5.
  // Lighthouse globally installed, node_modules/ in config directory.
  // ex: lighthouse https://test.com --config-path=./config/config.js
  //
  // working directory/
  //   |-- config/
  //     |-- node_modules/

View on GitHub (pinned to 9515cd4e58)

Solutions

  1. Verify the module path or package name is spelled correctly in your config.
  2. Install the module with npm/yarn if it is an external package.
  3. Use an absolute path or a path relative to your current working directory.

When it happens

Trigger: Thrown when a config-referenced module (plugin, gatherer, or audit) cannot be resolved from the Lighthouse module directory or the current working directory.

Common situations: See trigger scenarios.


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