eyaltoledano/claude-task-master · error
FILE_NOT_FOUND
FILE_NOT_FOUND
Error message
${error.message} What it means
When an `input` argument is provided, parsePRDDirect resolves it via resolvePrdPath (parse-prd.js:66-74). If that resolver throws — typically because the given relative path cannot be resolved to an existing PRD under the project's expected locations — the exception is reported as FILE_NOT_FOUND with the resolver's message.
Source
Thrown at mcp-server/src/core/direct-functions/parse-prd.js:72
return {
success: false,
error: {
code: 'MISSING_ARGUMENT',
message: 'projectRoot is required.'
}
};
}
// Resolve input path using path utilities
let inputPath;
if (inputArg) {
try {
inputPath = resolvePrdPath({ input: inputArg, projectRoot }, session);
} catch (error) {
logWrapper.error(`Error resolving PRD path: ${error.message}`);
return {
success: false,
error: { code: 'FILE_NOT_FOUND', message: error.message }
};
}
} else {
logWrapper.error('parsePRDDirect called without input path');
return {
success: false,
error: { code: 'MISSING_ARGUMENT', message: 'Input path is required' }
};
}
// Resolve output path - use new path utilities for default
const outputPath = outputArg
? path.isAbsolute(outputArg)
? outputArg
: path.resolve(projectRoot, outputArg)
: resolveProjectPath(TASKMASTER_TASKS_FILE, args) ||
path.resolve(projectRoot, TASKMASTER_TASKS_FILE);
View on GitHub (pinned to c0c98d367c)
Solutions
- Read `error.message` — it contains the path resolution failure detail from resolvePrdPath.
- Pass an absolute path to the PRD file to bypass relative-path ambiguity.
- Verify the file exists relative to `projectRoot`, not your current working directory.
- Check the conventional locations (e.g. .taskmaster/docs/ or scripts/prd.txt) if relying on name-only resolution.
Example fix
// before
await parsePRDDirect({ projectRoot: '/proj', input: 'prd.txt' }, log); // resolved relative to /proj, file not there
// after
await parsePRDDirect({ projectRoot: '/proj', input: '/proj/docs/prd.txt' }, log); Defensive patterns
Strategy: validation
Validate before calling
const path = require('path');
const fs = require('fs');
function prdInputResolvable(input, projectRoot) {
const abs = path.isAbsolute(input) ? input : path.resolve(projectRoot, input);
return fs.existsSync(abs);
} Type guard
function isResolvableInput(args) {
return typeof args?.input === 'string' && args.input.trim().length > 0;
} Try / catch
const result = await parsePRDDirect({ projectRoot, input }, log);
if (!result.success && result.error?.code === 'FILE_NOT_FOUND') {
console.error('PRD path could not be resolved:', result.error.message);
} Prevention
- Prefer absolute paths for the input argument.
- Resolve relative paths against projectRoot, not the shell cwd.
- Keep the PRD in a stable location like .taskmaster/docs/.
- Check the resolver's message for the path it attempted.
When it happens
Trigger: Passing an `input` path that resolvePrdPath cannot find: a relative path that doesn't exist relative to projectRoot or the .taskmaster/docs locations, or a nonexistent absolute path that the resolver validates before returning.
Common situations: Typos in the PRD filename; passing a path relative to the shell's cwd instead of projectRoot; moving/renaming the PRD after generation; running the tool from a different directory than expected so relative resolution lands elsewhere.
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
- projectRoot is required in args to resolve project paths
- FILE_NOT_FOUND_ERROR
- FILE_NOT_FOUND
- CORE_FUNCTION_ERROR
- PARSE_PRD_CORE_ERROR
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/535e75aa32cfd56c.
Report an issue: GitHub.