{"record":{"id":"54fb9d420c6722a9","repo":"thedotmack/claude-mem","slug":"installplugindependencies-no-package-json-at-ta","errorCode":null,"errorMessage":"installPluginDependencies: no package.json at ${targetDir}","messagePattern":"installPluginDependencies: no package\\.json at (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/npx-cli/install/setup-runtime.ts","lineNumber":428,"sourceCode":"  let version = getUvVersion();\n  if (!version) {\n    await new Promise((r) => setTimeout(r, 1000));\n    version = getUvVersion();\n  }\n  if (!version) {\n    installerError(ErrorSeverity.WARN_CONTINUE, {\n      component: 'uv-version-probe',\n      phase: 'setup-runtime',\n      cause: new Error(`uv at ${uvPath} did not respond to --version after retry`),\n    }, sum);\n    return { uvPath, version: 'unknown' };\n  }\n  return { uvPath, version };\n}\n\nexport async function installPluginDependencies(targetDir: string, bunPath: string): Promise<void> {\n  if (!existsSync(join(targetDir, 'package.json'))) {\n    throw new Error(`installPluginDependencies: no package.json at ${targetDir}`);\n  }\n\n  const bunCmd = IS_WINDOWS && bunPath.includes(' ') ? `\"${bunPath}\"` : bunPath;\n\n  // Per CHANGELOG v12.6.1 -> v12.6.2: tree-sitter-swift's nested\n  // tree-sitter-cli postinstall downloads a Rust binary and can hang the\n  // install. Bun honors trustedDependencies; npm does not. We additionally\n  // pass --ignore-scripts as belt-and-suspenders and bound it with a timeout.\n  // Async exec (not execSync): a blocked event loop freezes the installer's\n  // clack spinner for the duration of the install, which reads as a stall.\n  const runBunInstall = (): Promise<void> =>\n    new Promise<void>((resolve, reject) => {\n      exec(`${bunCmd} install --frozen-lockfile --ignore-scripts`, {\n        cwd: targetDir,\n        timeout: INSTALL_TIMEOUT_MS,\n        maxBuffer: 16 * 1024 * 1024,\n        ...(IS_WINDOWS ? { shell: process.env.ComSpec ?? 'cmd.exe' } : {}),\n      }, (error, stdout, stderr) =>","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/src/npx-cli/install/setup-runtime.ts#L410-L446","documentation":"Thrown by installPluginDependencies() when the targetDir passed in does not contain a package.json. The function's entire job is to run `bun install` (or the configured install) inside the plugin target, so a missing package.json means the target is not a valid installable project. It is a precondition check before spawning the installer.","triggerScenarios":"Calling installPluginDependencies with a path that is empty, wrong, or points at a directory that was never scaffolded. A plugin target dir whose package.json was deleted or never written by an earlier install step. A path constructed from a stale config value that no longer reflects the filesystem.","commonSituations":"An interrupted prior install left the target dir half-created. The target dir was supplied from a config/CLI arg that is incorrect. The plugin dir was moved or cleaned up between detection and install. Running install against a path inside a freshly-cloned repo before its own setup wrote package.json.","solutions":["Confirm targetDir is the intended plugin root and that it contains package.json (ls the dir).","Re-run the scaffolding/setup step that is supposed to write package.json into the target before calling installPluginDependencies.","If the path comes from config, update it to the correct plugin directory.","If package.json was deleted, restore it from git or regenerate it, then retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { existsSync } from 'fs';\nif (!existsSync(join(targetDir, 'package.json'))) {\n  throw new Error(`Target is not an installable project (no package.json): ${targetDir}`);\n}","typeGuard":"function isInstallableDir(dir: string): boolean {\n  return existsSync(join(dir, 'package.json'));\n}","tryCatchPattern":null,"preventionTips":["Ensure the scaffolding step that writes package.json runs before installPluginDependencies.","Derive targetDir from a single validated config source so it can't drift.","Validate the target dir with existsSync(package.json) before spawning bun install."],"tags":["install","validation","filesystem","plugin","precondition"],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}