{"record":{"id":"661090a7c041018f","repo":"paperclipai/paperclip","slug":"typescript-cli-not-found-at-tscclipath","errorCode":null,"errorMessage":"TypeScript CLI not found at ${tscCliPath}","messagePattern":"TypeScript CLI not found at (.+?)","errorType":"console","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/ensure-plugin-build-deps.mjs","lineNumber":37,"sourceCode":"    name: \"@paperclipai/shared\",\n    output: path.join(rootDir, \"packages/shared/dist/index.js\"),\n    completion: path.join(rootDir, \"packages/shared/dist/.paperclip-build-complete\"),\n    sourceDir: path.join(rootDir, \"packages/shared/src\"),\n    tsconfig: path.join(rootDir, \"packages/shared/tsconfig.json\"),\n    dependencies: [],\n  },\n  {\n    name: \"@paperclipai/plugin-sdk\",\n    output: path.join(rootDir, \"packages/plugins/sdk/dist/index.js\"),\n    completion: path.join(rootDir, \"packages/plugins/sdk/dist/.paperclip-build-complete\"),\n    sourceDir: path.join(rootDir, \"packages/plugins/sdk/src\"),\n    tsconfig: path.join(rootDir, \"packages/plugins/sdk/tsconfig.json\"),\n    dependencies: [0],\n  },\n];\n\nif (!fs.existsSync(tscCliPath)) {\n  throw new Error(`TypeScript CLI not found at ${tscCliPath}`);\n}\n\nfunction directoryFingerprint(directory, exclude) {\n  const hash = createHash(\"sha256\");\n  function visit(dir) {\n    for (const entry of fs.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {\n      const entryPath = path.join(dir, entry.name);\n      if (entryPath === exclude) continue;\n      if (entry.isDirectory()) {\n        visit(entryPath);\n      } else if (entry.isFile()) {\n        const content = fs.readFileSync(entryPath);\n        hash.update(JSON.stringify([path.relative(directory, entryPath), content.length]));\n        hash.update(content);\n      }\n    }\n  }\n  visit(directory);","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/scripts/ensure-plugin-build-deps.mjs#L19-L55","documentation":"This bootstrap script builds @paperclipai/shared and @paperclipai/plugin-sdk from source before plugins can load. It shells out to the TypeScript compiler located at node_modules/typescript/bin/tsc. If that file does not exist, dependencies were not installed (or TypeScript was removed/hoisted elsewhere), so it throws immediately before doing any work.","triggerScenarios":"Running scripts/ensure-plugin-build-deps.mjs (directly or via the plugin build path) when node_modules/typescript/bin/tsc is absent — e.g. `pnpm install` was never run, node_modules was partially deleted, TypeScript is not in the root dependency tree, or a pnpm version/hoisting change moved the binary.","commonSituations":"Fresh clone without `pnpm install`; CI checkout missing the install step; stale node_modules after a lockfile change that dropped typescript; running the script from a pruned/production install (`--prod`) where devDependencies like typescript are omitted.","solutions":["Run `pnpm install` at the repo root so node_modules/typescript/bin/tsc exists.","If install ran, check that typescript is a (dev)Dependency of the root workspace and re-add it if a lockfile update removed it.","If node_modules is corrupted or pruned, delete node_modules and reinstall (`rm -rf node_modules && pnpm install`).","As a last resort, verify the path expectation in scripts/ensure-plugin-build-deps.mjs:12 matches your package manager's layout (e.g. pnpm's virtual store) and adjust tscCliPath."],"exampleFix":"// before\n$ node scripts/ensure-plugin-build-deps.mjs\nError: TypeScript CLI not found at /repo/node_modules/typescript/bin/tsc\n// after\n$ pnpm install\n$ node scripts/ensure-plugin-build-deps.mjs\n[paperclip] plugin build deps ready","handlingStrategy":"validation","validationCode":"import fs from \"node:fs\";\nconst tscCliPath = \"node_modules/typescript/bin/tsc\";\nif (!fs.existsSync(tscCliPath)) {\n  console.error(\"Run `pnpm install` first: TypeScript CLI missing at \" + tscCliPath);\n  process.exit(1);\n}","typeGuard":"const hasTsc = (p) => fs.existsSync(p) && fs.statSync(p).isFile();","tryCatchPattern":null,"preventionTips":["Always run `pnpm install` after cloning or pulling lockfile changes before plugin builds.","Never install with --production/--prod in environments that build the SDK from source.","Verify node_modules/typescript exists in CI before invoking the script.","Keep typescript pinned as a root devDependency so hoisting keeps bin/tsc at the expected path."],"tags":["typescript","missing-dependency","build","node"],"backgroundTag":"file-not-found","analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}