{"id":"2d82d163e21618b1","repo":"jestjs/jest","slug":"jest-no-configuration-found-for-any-project","errorCode":null,"errorMessage":"jest: No configuration found for any project.","messagePattern":"jest: No configuration found for any project\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/jest-config/src/index.ts","lineNumber":480,"sourceCode":"          );\n        }),\n    );\n\n    ensureNoDuplicateConfigs(parsedConfigs, projects);\n    configs = parsedConfigs.map(({projectConfig}) => projectConfig);\n    if (!hasDeprecationWarnings) {\n      hasDeprecationWarnings = parsedConfigs.some(\n        ({hasDeprecationWarnings}) => !!hasDeprecationWarnings,\n      );\n    }\n    // If no config was passed initially, use the one from the first project\n    if (!globalConfig) {\n      globalConfig = parsedConfigs[0].globalConfig;\n    }\n  }\n\n  if (!globalConfig || configs.length === 0) {\n    throw new Error('jest: No configuration found for any project.');\n  }\n\n  return {\n    configs,\n    globalConfig,\n    hasDeprecationWarnings: !!hasDeprecationWarnings,\n  };\n}\n","sourceCodeStart":462,"sourceCodeEnd":489,"githubUrl":"https://github.com/jestjs/jest/blob/f49721c78e195558b40913977c9230f5b7f559d8/packages/jest-config/src/index.ts#L462-L489","documentation":"At the end of `readConfigs` (packages/jest-config/src/index.ts:479), if no project produced a globalConfig and no projectConfig was collected, Jest throws 'No configuration found for any project.' This means none of the project paths/cwd yielded a loadable Jest config.","triggerScenarios":"Running `jest` in a directory with no jest.config.* and no `jest` field in package.json; all project paths were filtered out (e.g. glob matched nothing or only non-config files); passing `--projects` pointing at non-existent directories.","commonSituations":"Fresh project that hasn't added Jest config yet; running from the wrong working directory; CI that checks out a sub-tree without the root config; all listed projects filtered by the 'ignore non-config, non-directory' filter at index.ts:434.","solutions":["Create a jest.config.js (or .ts/.mjs/.cjs/.json) in the project root, or add a `\"jest\"` field to package.json.","Verify you are running Jest from the directory that contains (or is above) the config.","Check that `--projects` paths exist and are directories or valid config files."],"exampleFix":"// before: no config anywhere, jest fails to start\n\n// after: create jest.config.js\nmodule.exports = { testEnvironment: 'node' };","handlingStrategy":"validation","validationCode":"import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport {constants} from 'jest-config';\nfunction hasJestConfig(dir: string): boolean {\n  if (fs.existsSync(path.join(dir, 'package.json')) && JSON.parse(fs.readFileSync(path.join(dir,'package.json'),'utf8')).jest) return true;\n  return constants.JEST_CONFIG_EXT_ORDER.some(ext => fs.existsSync(path.join(dir, `jest.config${ext}`)));\n}","typeGuard":"const configExists = (dir: string) => {\n  try { return hasJestConfig(dir); } catch { return false; }\n};","tryCatchPattern":null,"preventionTips":["Always ship a jest.config.* (or package.json jest field) in the project root.","Run Jest from the directory containing the config.","In monorepos, ensure each runnable package resolves to a config."],"tags":["jest-config","config","projects","bootstrap"],"analyzedSha":"f49721c78e195558b40913977c9230f5b7f559d8","analyzedAt":"2026-08-03T20:16:28.571Z","schemaVersion":2}