{"record":{"id":"1e44cd01fe703789","repo":"n8n-io/n8n","slug":"claude-not-on-path","errorCode":null,"errorMessage":"claude not on PATH","messagePattern":"claude not on PATH","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/cli/build-mcp-manifest.ts","lineNumber":446,"sourceCode":"}\n\n/** Keep only slugs whose `datasets` includes `tier`, mirroring eval:instance-ai --tier semantics. */\nfunction filterSlugsByTier(workflowDir: string, slugs: string[], tier: string): string[] {\n\treturn slugs.filter((slug) => readDatasets(workflowDir, slug).includes(tier));\n}\n\nasync function main(): Promise<void> {\n\tconst parsed = parseArgs(process.argv.slice(2));\n\tif (parsed.helpRequested) {\n\t\tprocess.stdout.write(HELP);\n\t\treturn;\n\t}\n\tconst args = parsed.args!;\n\n\ttry {\n\t\texecSync('command -v claude', { stdio: 'ignore' });\n\t} catch {\n\t\tthrow new Error('claude not on PATH');\n\t}\n\n\t// Repo root scopes the staged MCP config (cwd fallback). Best-effort: the disk\n\t// source resolves/validates its own test-case dir below; langtracer pulls cases\n\t// over MCP, so it needs no repo at all and can run outside the n8n checkout.\n\tlet repoRoot: string | undefined;\n\ttry {\n\t\trepoRoot = execSync('git rev-parse --show-toplevel', { stdio: ['ignore', 'pipe', 'ignore'] })\n\t\t\t.toString()\n\t\t\t.trim();\n\t} catch {\n\t\trepoRoot = undefined;\n\t}\n\n\tif (args.buildCwd && !existsSync(args.buildCwd)) {\n\t\tthrow new Error(`--build-cwd directory does not exist: ${args.buildCwd}`);\n\t}\n","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/cli/build-mcp-manifest.ts#L428-L464","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install the Claude Code CLI (see https://docs.claude.com/claude-code)","Verify it is reachable: command -v claude or which claude","If installed via npm globally, ensure the global bin directory is on PATH","If using nvm, activate the correct node version before running"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { execSync } from 'child_process';\ntry {\n  execSync('command -v claude', { stdio: 'ignore' });\n} catch {\n  throw new Error('claude not on PATH — install Claude Code CLI first');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the Claude Code CLI before running this tool","Verify with 'which claude' or 'command -v claude' in the same shell session","In CI, install the CLI as a setup step and verify before invoking build-mcp-manifest"],"tags":["cli","prerequisites","env","claude","build-mcp-manifest"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}