{"record":{"id":"c017a9d4d60e90ed","repo":"github/copilot-sdk","slug":"label-not-found-at-path","errorCode":null,"errorMessage":"${label} not found at ${path}.","messagePattern":"(.+?) not found at (.+?)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodejs/src/runtimeArtifacts.ts","lineNumber":68,"sourceCode":"    \"LICENSE.md\",\n    \"napi-oop-runtime\",\n    \"npm-loader.js\",\n    \"package.json\",\n    \"pvrecorder\",\n    \"queries\",\n    \"README.md\",\n    \"sea-loader.js\",\n    \"webview\",\n]);\n\ninterface RuntimeAsset {\n    source: string;\n    relativePath: string;\n}\n\nexport function validateFile(path: string, label: string): void {\n    if (!existsSync(path)) {\n        throw new Error(`${label} not found at ${path}.`);\n    }\n    if (statSync(path).size === 0) {\n        throw new Error(`${label} at ${path} is empty.`);\n    }\n}\n\nfunction validateRuntimeBundle(wrapper: string, runtimeNode: string): void {\n    validateFile(wrapper, \"Copilot runtime wrapper\");\n    validateFile(runtimeNode, \"Copilot runtime.node\");\n}\n\nfunction isExcluded(relativePath: string): boolean {\n    const parts = relativePath.split(sep);\n    const topLevel = parts[0];\n    const fileName = parts.at(-1) ?? \"\";\n    return (\n        EXCLUDED_TOP_LEVEL.has(topLevel) ||\n        /^tree-sitter.*\\.wasm$/.test(topLevel) ||","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/nodejs/src/runtimeArtifacts.ts#L50-L86","documentation":"validateFile asserts a required runtime artifact exists on disk before the SDK uses it. When the path does not exist it throws '<label> not found at <path>'. It is used to verify the Copilot runtime wrapper and runtime.node inside platform packages.","triggerScenarios":"ensureCopilotPackage, downloadCopilotPackage, validateRuntimeBundle, or ensureRuntimeBundle is called and the wrapper/runtime.node path passed to validateFile does not exist on disk.","commonSituations":"Partial npm install that skipped optional platform packages, corrupted install, wrong packageSearchPaths, CI cache that pruned prebuild directories, running on a platform with no package published.","solutions":["Reinstall the SDK: npm install @github/copilot-sdk (ensures the platform package is restored).","Clear npm cache and node_modules, then reinstall to repair a corrupted install.","Verify the platform package (e.g. @github/copilot-linux-x64) actually appears in node_modules.","Check packageSearchPaths/options point at the right node_modules root."],"exampleFix":"// before\nls node_modules/@github/copilot-linux-x64/prebuilds/linux-x64/  # runtime.node missing\n\n// after\nrm -rf node_modules package-lock.json && npm install","handlingStrategy":"validation","validationCode":"import { existsSync, statSync } from 'fs';\nif (!existsSync(path)) throw new Error(`${label} missing at ${path}; reinstall @github/copilot-sdk`);","typeGuard":null,"tryCatchPattern":"try {\n  const wrapper = getBundledRuntimePath();\n} catch (e) {\n  if (e.message.includes('not found at')) {\n    // trigger reinstall instructions / fallback to another install root\n  } else throw e;\n}","preventionTips":["Always install with optional dependencies enabled.","Verify platform package presence in CI before launching sessions.","Avoid copying node_modules between machines/OSes."],"tags":["filesystem","missing-artifact","install","nodejs"],"backgroundTag":"file-not-found","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}