eyaltoledano/claude-task-master · error

outputPath is required and must be a non-empty string

Error message

outputPath is required and must be a non-empty string

What it means

displayParsePrdStart also requires a valid outputPath where parsed tasks will be written. It throws when outputPath is missing, not a string, or empty/whitespace-only. The PRD path may be fine but the destination must also be a usable string before the UI banner renders.

Source

Thrown at src/ui/parse-prd.js:171

	research = false,
	force = false,
	existingTasks = [],
	nextId = 1
}) {
	// Input validation
	if (
		!prdFilePath ||
		typeof prdFilePath !== 'string' ||
		prdFilePath.trim() === ''
	) {
		throw new Error('prdFilePath is required and must be a non-empty string');
	}
	if (
		!outputPath ||
		typeof outputPath !== 'string' ||
		outputPath.trim() === ''
	) {
		throw new Error('outputPath is required and must be a non-empty string');
	}

	// Build and display the main message box
	const message = buildMainMessage({
		prdFilePath,
		outputPath,
		numTasks,
		model,
		temperature,
		append,
		research
	});
	displayMainMessageBox(message);

	// Display append/force notices beneath the boxen if either flag is set
	if (append || force) {
		// Add append mode details if enabled
		if (append) {

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Supply an explicit outputPath string such as '.taskmaster/tasks'
  2. Ensure the CLI/config layer defaults output to '.taskmaster/tasks' when unset
  3. Cast or normalize any Path-like value with String(path) before calling

Example fix

// before
const output = cfg.tasksDir; // possibly undefined
displayParsePrdStart(prd, output, options);
// after
const output = cfg.tasksDir || '.taskmaster/tasks';
displayParsePrdStart(prd, output, options);
Defensive patterns

Strategy: validation

Validate before calling

if (typeof outputPath !== 'string' || outputPath.trim() === '') {
  outputPath = '.taskmaster/tasks'; // apply default before calling
}

Type guard

const isUsablePath = (v) => typeof v === 'string' && v.trim().length > 0;

Try / catch

try {
  displayParsePrdStart(prdFilePath, outputPath, options);
} catch (err) {
  if (err.message.startsWith('outputPath is required')) {
    displayParsePrdStart(prdFilePath, '.taskmaster/tasks', options);
  } else throw err;
}

Prevention

When it happens

Trigger: Calling displayParsePrdStart with outputPath undefined/null, a non-string (e.g. number or object), or whitespace-only string, while prdFilePath passed validation.

Common situations: --output flag omitted and no default applied; options object built from JSON config missing the output key; passing a Path object or number instead of a string; trailing-slash-only or whitespace value from a shell variable.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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