eyaltoledano/claude-task-master · error

FILE_NOT_FOUND

FILE_NOT_FOUND

Error message

Tasks file not found at ${tasksPath}

What it means

After receiving tasksJsonPath, fixDependenciesDirect verifies the file exists on disk with fs.existsSync. A missing file yields a FILE_NOT_FOUND error result naming the path that was checked. It prevents the core dependency-fix logic from failing obscurely on a nonexistent file.

Source

Thrown at mcp-server/src/core/direct-functions/fix-dependencies.js:47

			log.error('fixDependenciesDirect called without tasksJsonPath');
			return {
				success: false,
				error: {
					code: 'MISSING_ARGUMENT',
					message: 'tasksJsonPath is required'
				}
			};
		}

		// Use provided path
		const tasksPath = tasksJsonPath;

		// Verify the file exists
		if (!fs.existsSync(tasksPath)) {
			return {
				success: false,
				error: {
					code: 'FILE_NOT_FOUND',
					message: `Tasks file not found at ${tasksPath}`
				}
			};
		}

		// Enable silent mode to prevent console logs from interfering with JSON response
		enableSilentMode();

		const options = { projectRoot, tag };
		// Call the original command function using the provided path and proper context
		await fixDependenciesCommand(tasksPath, options);

		// Restore normal logging
		disableSilentMode();

		return {
			success: true,
			data: {

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Verify the path with ls/existsSync and correct any typo
  2. Run project initialization (task_master init or initialize_project) to create tasks.json if it does not exist
  3. Pass the canonical path: <projectRoot>/.taskmaster/tasks/tasks.json
  4. If using ~ or env vars in the path, expand them client-side before sending

Example fix

// before
await mcp.call('fix_dependencies', { tasksJsonPath: '~/repo/.taskmaster/tasks/tasks.json' });
// after
import path from 'path';
import os from 'os';
const p = path.join(os.homedir(), 'repo/.taskmaster/tasks/tasks.json');
if (!fs.existsSync(p)) throw new Error(`tasks.json missing at ${p}; run init first`);
await mcp.call('fix_dependencies', { tasksJsonPath: p });
Defensive patterns

Strategy: validation

Validate before calling

import fs from 'fs';
import path from 'path';
const tasksPath = path.resolve(projectRoot, '.taskmaster/tasks/tasks.json');
if (!fs.existsSync(tasksPath)) {
  throw new Error(`tasks.json not found at ${tasksPath}. Run initialize_project first.`);
}
if (!fs.statSync(tasksPath).isFile()) {
  throw new Error(`${tasksPath} is not a file`);
}

Type guard

function tasksFileExists(p) {
  try { return fs.statSync(p).isFile(); } catch { return false; }
}

Try / catch

const res = await callTool('fix_dependencies', { tasksJsonPath });
if (!res.success && res.error?.code === 'FILE_NOT_FOUND') {
  console.error(res.error.message); // names the exact path checked
  // recover: initialize the project or correct the path, then retry
}

Prevention

When it happens

Trigger: tasksJsonPath points to a path that does not exist: wrong project root, file not yet initialized, renamed .taskmaster directory, or path with wrong casing/tilde left unexpanded.

Common situations: Running the MCP server before ever initializing the project; passing an absolute path from another machine/container; typos like tasks.jsn; symlinked roots broken after a checkout.

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/daabe2c826258d85. Report an issue: GitHub.