{"record":{"id":"6283be6f67ceb538","repo":"eyaltoledano/claude-task-master","slug":"project-root-override-is-not-a-valid-taskmaster-pr","errorCode":null,"errorMessage":"Project root override is not a valid taskmaster project: ${resolvedOverride}","messagePattern":"Project root override is not a valid taskmaster project: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task-master.js","lineNumber":245,"sourceCode":"\n\t// Project Root\n\tif (overrides.projectRoot) {\n\t\tconst resolvedOverride = path.resolve(overrides.projectRoot);\n\t\tif (!fs.existsSync(resolvedOverride)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Project root override path does not exist: ${resolvedOverride}`\n\t\t\t);\n\t\t}\n\n\t\tconst hasTaskmasterDir = fs.existsSync(\n\t\t\tpath.join(resolvedOverride, TASKMASTER_DIR)\n\t\t);\n\t\tconst hasLegacyConfig = fs.existsSync(\n\t\t\tpath.join(resolvedOverride, LEGACY_CONFIG_FILE)\n\t\t);\n\n\t\tif (!hasTaskmasterDir && !hasLegacyConfig) {\n\t\t\tthrow new Error(\n\t\t\t\t`Project root override is not a valid taskmaster project: ${resolvedOverride}`\n\t\t\t);\n\t\t}\n\n\t\tpaths.projectRoot = resolvedOverride;\n\t} else {\n\t\t// findProjectRoot now always returns a value (fallback to cwd)\n\t\tpaths.projectRoot = findProjectRoot();\n\t}\n\n\t// TaskMaster Directory\n\tif ('taskMasterDir' in overrides) {\n\t\tpaths.taskMasterDir = resolvePath(\n\t\t\t'taskmaster directory',\n\t\t\toverrides.taskMasterDir,\n\t\t\t[TASKMASTER_DIR],\n\t\t\tpaths.projectRoot\n\t\t);","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/src/task-master.js#L227-L263","documentation":"After confirming the projectRoot override exists, initTaskMaster() checks it is actually a taskmaster project: it must contain either the TASKMASTER_DIR directory (e.g. .taskmaster) or the legacy config file. A valid but non-taskmaster directory (random folder, empty checkout, wrong repo) fails this validation with the resolved path in the message.","triggerScenarios":"projectRoot points at a fresh repo where task-master init was never run; pointing at a parent directory containing the project rather than the project itself; pointing at a subdir of the project that lacks .taskmaster/; project migrated away from legacy config without creating TASKMASTER_DIR.","commonSituations":"Mono-repo misconfiguration where projectRoot is the repo root but taskmaster lives in a package subdirectory; fresh CI checkouts skipping the init step; typos landing in a sibling directory that exists but isn't initialized.","solutions":["Run task-master init in that directory to create the .taskmaster structure (or the legacy config file).","Point projectRoot at the actual project directory containing .taskmaster/, not a parent or sibling.","Copy/restore the .taskmaster directory (it may be git-ignored and missing on fresh clones).","Verify with ls <root>/.taskmaster that the marker directory is present."],"exampleFix":"// before\ntaskMaster({ projectRoot: '/repo' });            // repo root, project is /repo/packages/app\ntaskMaster({ projectRoot: '/repo/apps/cli' });   // subdir without .taskmaster\n// after\ntaskMaster({ projectRoot: '/repo/apps/app-with-taskmaster' });\n// or run: cd /repo/apps/app-with-taskmaster && task-master init","handlingStrategy":"validation","validationCode":"function assertIsTaskmasterProject(root) {\n  const resolved = path.resolve(root);\n  const ok =\n    fs.existsSync(path.join(resolved, '.taskmaster')) ||\n    fs.existsSync(path.join(resolved, 'taskmaster.config.json'));\n  if (!ok) {\n    throw new Error(`${resolved} is not a taskmaster project — run 'task-master init'`);\n  }\n}\nassertIsTaskmasterProject(cfg.projectRoot);","typeGuard":null,"tryCatchPattern":"try {\n  const tm = taskMaster({ projectRoot: cfg.projectRoot });\n} catch (err) {\n  if (err.message.startsWith('Project root override is not a valid taskmaster project')) {\n    console.error(err.message);\n    console.error(\"Fix: run 'task-master init' in that directory, or point projectRoot at the directory containing .taskmaster/\");\n    process.exit(1);\n  }\n  throw err;\n}","preventionTips":["Run task-master init before using a directory as projectRoot.","Point projectRoot at the exact directory containing .taskmaster/, not a parent or sibling.","Ensure .taskmaster/ is created in CI when it is git-ignored (bootstrap step).","In monorepos, configure one projectRoot per package that actually contains taskmaster files.","Check for a marker file (ls <root>/.taskmaster) before configuring the override."],"tags":["configuration","validation","project-structure","taskmaster"],"backgroundTag":"missing-project-config","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}