eyaltoledano/claude-task-master · warning

Source file not found: ${item.from}

Error message

Source file not found: ${item.from}

What it means

performMigration iterates the migration plan and copies each file. If a planned source path no longer exists on disk when the copy step runs, it warns and skips that item instead of crashing, keeping the rest of the migration intact.

Source

Thrown at scripts/modules/task-manager/migrate.js:229

	}

	// Create backup if requested
	if (options.backup) {
		const backupDir = path.join(projectRoot, '.taskmaster-migration-backup');
		log.info(`Creating backup in: ${backupDir}`);
		if (fs.existsSync(backupDir)) {
			fs.rmSync(backupDir, { recursive: true, force: true });
		}
		fs.mkdirSync(backupDir, { recursive: true });
	}

	// Migrate files
	for (const item of migrationPlan) {
		const fromPath = path.join(projectRoot, item.from);
		const toPath = path.join(projectRoot, item.to);

		if (!fs.existsSync(fromPath)) {
			log.warn(`Source file not found: ${item.from}`);
			continue;
		}

		// Create backup if requested
		if (options.backup) {
			const backupPath = path.join(
				projectRoot,
				'.taskmaster-migration-backup',
				item.from
			);
			const backupDir = path.dirname(backupPath);
			if (!fs.existsSync(backupDir)) {
				fs.mkdirSync(backupDir, { recursive: true });
			}
			fs.copyFileSync(fromPath, backupPath);
		}

		// Ensure destination directory exists

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Verify the file exists at <projectRoot>/<item.from>; restore it or remove it from the migration plan.
  2. Re-run the full migration (analyze + perform) in one pass so the plan matches the current filesystem.
  3. If the file was intentionally deleted, ignore this warning — the rest of the migration continues.

Example fix

// before
const plan = await analyzeMigrationNeeds(root);
await someDelay(); // file deleted in the meantime
await performMigration(root, plan);
// after
const plan = await analyzeMigrationNeeds(root);
await performMigration(root, plan); // analyze and perform together
Defensive patterns

Strategy: try-catch

Validate before calling

plan.forEach(item => {
  if (!fs.existsSync(path.join(projectRoot, item.from))) {
    console.warn(`Plan references missing file: ${item.from}`);
  }
});

Try / catch

try {
  await performMigration(projectRoot, plan, options);
} catch (e) {
  console.error('Migration failed:', e.message);
  // restore from backup if options.backup was used
}

Prevention

When it happens

Trigger: A migrationPlan item's 'from' path (relative to projectRoot) is missing at execution time — usually because the file was deleted/moved between analyzeMigrationNeeds and performMigration, or a plan item was hand-constructed with a wrong relative path.

Common situations: Running analyze and perform steps separately (e.g. via API) with filesystem changes in between; dry-run plan reviewed then files removed before applying; custom tooling generating the plan with incorrect paths.

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