{"record":{"id":"ed59083ca08c6e94","repo":"github/copilot-sdk","slug":"copilot-cli-not-found-at-this-resolvedclipath","errorCode":null,"errorMessage":"Copilot CLI not found at ${this.resolvedCliPath}. Set COPILOT_CLI_PATH to use a custom installation.","messagePattern":"Copilot CLI not found at (.+?)\\. Set COPILOT_CLI_PATH to use a custom installation\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodejs/src/client.ts","lineNumber":2653,"sourceCode":"            }\n\n            // Suppress debug/trace output that might pollute stdout, and apply the\n            // shared runtime env (auth token, connection token, COPILOT_HOME, telemetry).\n            const envWithoutNodeDebug = this.buildRuntimeEnv();\n\n            if (!this.resolvedCliPath) {\n                throw new Error(\n                    \"Path to Copilot CLI is required. Please supply it via \" +\n                        \"`RuntimeConnection.forStdio({ path })` or \" +\n                        \"`RuntimeConnection.forTcp({ path })`, set the COPILOT_CLI_PATH \" +\n                        \"environment variable, or use `RuntimeConnection.forUri(...)` to \" +\n                        \"connect to an already-running runtime.\"\n                );\n            }\n\n            // Verify CLI exists before attempting to spawn\n            if (!existsSync(this.resolvedCliPath)) {\n                throw new Error(\n                    `Copilot CLI not found at ${this.resolvedCliPath}. Set COPILOT_CLI_PATH to use a custom installation.`\n                );\n            }\n\n            const stdioConfig: [\"pipe\", \"pipe\", \"pipe\"] | [\"ignore\", \"pipe\", \"pipe\"] =\n                this.connectionConfig.kind === \"stdio\"\n                    ? [\"pipe\", \"pipe\", \"pipe\"]\n                    : [\"ignore\", \"pipe\", \"pipe\"];\n\n            // For .js files, spawn node explicitly; for executables, spawn directly\n            const isJsFile = this.resolvedCliPath.endsWith(\".js\");\n            if (isJsFile) {\n                this.cliProcess = spawn(getNodeExecPath(), [this.resolvedCliPath, ...args], {\n                    stdio: stdioConfig,\n                    cwd: this.options.workingDirectory,\n                    env: envWithoutNodeDebug,\n                    windowsHide: true,\n                });","sourceCodeStart":2635,"sourceCodeEnd":2671,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/nodejs/src/client.ts#L2635-L2671","documentation":"Thrown by CopilotClient at spawn time when the resolved Copilot CLI executable does not exist on disk. The SDK resolves the CLI from the default install location or COPILOT_CLI_PATH; if the file is missing there it cannot launch the runtime subprocess, so it fails fast before any transport is opened.","triggerScenarios":"Thrown at nodejs/src/client.ts:2653 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install the GitHub Copilot CLI (e.g. `npm install -g @github/copilot`) so the default lookup path resolves","Set the COPILOT_CLI_PATH environment variable to the absolute path of the CLI executable","Pass an explicit path via RuntimeConnection.forStdio({ path }) or RuntimeConnection.forTcp({ path })","Verify the resolved path exists and is executable (check permissions, or a deleted install after an upgrade)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}