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}
       ${relativePath}

What it means

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

Source

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

  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/
  //     |-- config.js
  //     |-- package.json
  try {
    return require.resolve(moduleIdentifier, {paths: [configDir]});
  } catch (requireError) {}

  throw new Error(errorString + `
       ${relativePath}`);
}

/**
 * Many objects in the config can be an object whose properties are not serializable.
 * We use a shallow clone for these objects instead.
 * Any value that isn't an object will not be cloned.
 *
 * @template T
 * @param {T} item
 * @return {T}
 */
function shallowClone(item) {
  if (typeof item === 'object') {
    // Return copy of instance and prototype chain (in case item is instantiated class).
    return Object.assign(
      Object.create(
        Object.getPrototypeOf(item)

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. Check the relative path listed and make sure the file exists at one of the tried locations.

When it happens

Trigger: Thrown when a config-referenced module cannot be resolved from the Lighthouse module directory, the current working directory, or a relative config path.

Common situations: See trigger scenarios.


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