eyaltoledano/claude-task-master · error

Required ${pathType} not found. Searched: ${defaultPaths.joi

Error message

Required ${pathType} not found. Searched: ${defaultPaths.join(', ')}

What it means

When a path is marked required (override === true) and none of the candidate default locations contain the file/directory, resolvePath() throws with the list of paths it searched. This indicates the project is missing a mandatory taskmaster artifact (e.g. PRD, config, tasks file) in every standard location relative to basePath or process.cwd().

Source

Thrown at src/task-master.js:208

					throw new Error(
						`${pathType} override path does not exist: ${resolvedPath}`
					);
				}
			}
			return resolvedPath;
		}

		if (override === true) {
			// Required path - search defaults and fail if not found
			for (const defaultPath of defaultPaths) {
				const fullPath = path.isAbsolute(defaultPath)
					? defaultPath
					: path.join(basePath || process.cwd(), defaultPath);
				if (fs.existsSync(fullPath)) {
					return fullPath;
				}
			}
			throw new Error(
				`Required ${pathType} not found. Searched: ${defaultPaths.join(', ')}`
			);
		}

		// Optional path (override === false/undefined) - search defaults, return null if not found
		for (const defaultPath of defaultPaths) {
			const fullPath = path.isAbsolute(defaultPath)
				? defaultPath
				: path.join(basePath || process.cwd(), defaultPath);
			if (fs.existsSync(fullPath)) {
				return fullPath;
			}
		}

		return null;
	};

	const paths = {};

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Create the required file in one of the listed searched locations (the message enumerates them).
  2. Run the init/creation command that generates the missing artifact (e.g. task-master init or init-prd).
  3. Run the CLI from the project root, or pass an explicit override path via config/flags.
  4. Pass basePath explicitly if the defaults should be resolved relative to a non-cwd root.

Example fix

// before
cd ~/ && task-master list   // cwd has no .taskmaster
// after
cd /path/to/my-project && task-master list
// or
mkdir -p .taskmaster && task-master init
Defensive patterns

Strategy: fallback

Validate before calling

function firstExisting(paths) {
  return paths.find((p) => fs.existsSync(p)) ?? null;
}
const found = firstExisting(defaultCandidates);
if (!found) {
  // create the artifact or chdir to the project root before invoking
  fs.mkdirSync('.taskmaster', { recursive: true });
}

Try / catch

try {
  paths.prd = tm.resolvePath({ prdPath: true }); // required
} catch (err) {
  if (err.message.startsWith('Required') && err.message.includes('not found. Searched:')) {
    console.error(err.message); // lists searched locations
    console.error('Run `task-master init` in your project root to create missing files');
    process.exit(1);
  }
  throw err;
}

Prevention

When it happens

Trigger: Running a command that requires e.g. the PRD file in a project that has never had one created; running from the wrong directory so basePath defaults to an empty project; required override true with no explicit path and the file deleted after creation.

Common situations: Fresh clones missing git-ignored .taskmaster artifacts; running the CLI outside the project root in CI; a teammate deleting the required file while config still marks it required; project initialized with a different directory layout than the searched defaults.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/dfb0be4b1d4c282d. Report an issue: GitHub.