{"record":{"id":"5299d59f84185fe6","repo":"GoogleChrome/lighthouse","slug":"unable-to-locate-moduleidentifier-tried","errorCode":null,"errorMessage":"Unable to locate `${moduleIdentifier}`.\n     Tried to resolve the module from these locations:\n       ${getModuleDirectory(import.meta)}\n       ${cwdPath}","messagePattern":"Unable to locate `(.+?)`\\.\n     Tried to resolve the module from these locations:\n       (.+?)\n       (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/config/config-helpers.js","lineNumber":520,"sourceCode":"  } catch (e) {}\n\n  // 3.\n  // See if the module resolves relative to the current working directory.\n  // Most useful to handle the case of invoking Lighthouse as a module, since\n  // then the config is an object and so has no path.\n  const cwdPath = path.resolve(process.cwd(), moduleIdentifier);\n  try {\n    return require.resolve(cwdPath);\n  } catch (e) {}\n\n  const errorString = 'Unable to locate ' + (category ? `${category}: ` : '') +\n    `\\`${moduleIdentifier}\\`.\n     Tried to resolve the module from these locations:\n       ${getModuleDirectory(import.meta)}\n       ${cwdPath}`;\n\n  if (!configDir) {\n    throw new Error(errorString);\n  }\n\n  // 4.\n  // Try looking up relative to the config file path. Just like the\n  // relative path passed to `require()` is found relative to the file it's\n  // in, this allows module paths to be specified relative to the config file.\n  const relativePath = path.resolve(configDir, moduleIdentifier);\n  try {\n    return require.resolve(relativePath);\n  } catch (requireError) {}\n\n  // 5.\n  // Lighthouse globally installed, node_modules/ in config directory.\n  // ex: lighthouse https://test.com --config-path=./config/config.js\n  //\n  // working directory/\n  //   |-- config/\n  //     |-- node_modules/","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/GoogleChrome/lighthouse/blob/9515cd4e58ebed69f78742d932b501c2cab8ad8f/core/config/config-helpers.js#L502-L538","documentation":"Error \"Unable to locate `${moduleIdentifier}`.\n     Tried to resolve the module from these locations:\n       ${getModuleDirectory(import.meta)}\n       ${cwdPath}\" thrown in GoogleChrome/lighthouse.","triggerScenarios":"Thrown when a config-referenced module (plugin, gatherer, or audit) cannot be resolved from the Lighthouse module directory or the current working directory.","commonSituations":"See trigger scenarios.","solutions":["Verify the module path or package name is spelled correctly in your config.","Install the module with npm/yarn if it is an external package.","Use an absolute path or a path relative to your current working directory."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9515cd4e58ebed69f78742d932b501c2cab8ad8f","analyzedAt":"2026-08-13T06:28:10.346Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}