n8n-io/n8n · error · Error

claude not on PATH

Error message

claude not on PATH

What it means

The build-mcp-manifest CLI drives the Anthropic Claude CLI (claude -p) to build workflows via an MCP server. Before doing any work, main() (line 443) runs `command -v claude` to verify the binary is reachable. If it is not found, the error is thrown immediately — there is no fallback builder, so proceeding would only produce confusing downstream failures.

Source

Thrown at packages/@n8n/instance-ai/evaluations/cli/build-mcp-manifest.ts:446

}

/** Keep only slugs whose `datasets` includes `tier`, mirroring eval:instance-ai --tier semantics. */
function filterSlugsByTier(workflowDir: string, slugs: string[], tier: string): string[] {
	return slugs.filter((slug) => readDatasets(workflowDir, slug).includes(tier));
}

async function main(): Promise<void> {
	const parsed = parseArgs(process.argv.slice(2));
	if (parsed.helpRequested) {
		process.stdout.write(HELP);
		return;
	}
	const args = parsed.args!;

	try {
		execSync('command -v claude', { stdio: 'ignore' });
	} catch {
		throw new Error('claude not on PATH');
	}

	// Repo root scopes the staged MCP config (cwd fallback). Best-effort: the disk
	// source resolves/validates its own test-case dir below; langtracer pulls cases
	// over MCP, so it needs no repo at all and can run outside the n8n checkout.
	let repoRoot: string | undefined;
	try {
		repoRoot = execSync('git rev-parse --show-toplevel', { stdio: ['ignore', 'pipe', 'ignore'] })
			.toString()
			.trim();
	} catch {
		repoRoot = undefined;
	}

	if (args.buildCwd && !existsSync(args.buildCwd)) {
		throw new Error(`--build-cwd directory does not exist: ${args.buildCwd}`);
	}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Install the Claude Code CLI (see https://docs.claude.com/claude-code)
  2. Verify it is reachable: command -v claude or which claude
  3. If installed via npm globally, ensure the global bin directory is on PATH
  4. If using nvm, activate the correct node version before running
Defensive patterns

Strategy: validation

Validate before calling

import { execSync } from 'child_process';
try {
  execSync('command -v claude', { stdio: 'ignore' });
} catch {
  throw new Error('claude not on PATH — install Claude Code CLI first');
}

Prevention

When it happens

Trigger: Running `pnpm eval:build-mcp-manifest` on a machine where the Claude Code CLI is not installed or is not on the PATH. This includes CI environments, fresh machines, and non-interactive shells where PATH differs from the interactive profile.

Common situations: Fresh machine without Claude Code installed. The Claude CLI was installed under a different nvm/node version. PATH is not exported correctly in non-interactive shell sessions (cron, CI). The binary name changed in a newer version.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/1e44cd01fe703789. Report an issue: GitHub.