{"record":{"id":"f8d3e894156ce066","repo":"thedotmack/claude-mem","slug":"uninstall-could-not-read-projectpath","errorCode":null,"errorMessage":"[uninstall] Could not read ${projectPath}:","messagePattern":"\\[uninstall\\] Could not read (.+?):","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/npx-cli/commands/uninstall.ts","lineNumber":210,"sourceCode":"      }\n    }\n  }\n\n  const cacheRoot = join(home, '.cache', 'claude-cli-nodejs');\n  if (existsSync(cacheRoot)) {\n    let projectDirs: string[] = [];\n    try {\n      projectDirs = readdirSync(cacheRoot);\n    } catch (error: unknown) {\n      console.warn(`[uninstall] Could not read ${cacheRoot}:`, error instanceof Error ? error.message : String(error));\n    }\n    for (const projectDir of projectDirs) {\n      const projectPath = join(cacheRoot, projectDir);\n      let logEntries: string[] = [];\n      try {\n        logEntries = readdirSync(projectPath);\n      } catch (error: unknown) {\n        console.warn(`[uninstall] Could not read ${projectPath}:`, error instanceof Error ? error.message : String(error));\n        continue;\n      }\n      for (const entry of logEntries) {\n        if (!entry.startsWith('mcp-logs-plugin-claude-mem-')) continue;\n        const logPath = join(projectPath, entry);\n        try {\n          rmSync(logPath, { recursive: true, force: true });\n          removedCount++;\n        } catch (error: unknown) {\n          console.warn(`[uninstall] Could not remove ${logPath}:`, error instanceof Error ? error.message : String(error));\n        }\n      }\n    }\n  }\n\n  const pluginDataDir = join(home, '.claude', 'plugins', 'data', 'claude-mem-thedotmack');\n  if (existsSync(pluginDataDir)) {\n    try {","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/npx-cli/commands/uninstall.ts#L192-L228","documentation":"Inside the cache sweep, each project directory under ~/.cache/claude-cli-nodejs is listed with readdirSync. If one project directory cannot be read, uninstall warns and continues with the next directory, so only that project's claude-mem MCP logs are left behind.","triggerScenarios":"`npx claude-mem uninstall` when an individual project cache directory has restrictive permissions, was deleted between listing and reading, or is not actually a directory (a stray file where a dir was expected).","commonSituations":"Per-project directories created under different credentials; cleanup tools (bleachbit, CCleaner) deleting cache contents while uninstall runs.","solutions":["Check the path in the message: ls -ld <projectPath>","Fix ownership and permissions, or remove the directory: rm -rf <projectPath>, then re-run uninstall","Ignore it if stale MCP logs for that one project do not matter"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { statSync, accessSync, constants } from 'node:fs';\n// Skip entries that are not readable directories before handing them to a sweep\nconst st = statSync(projectPath);\nif (st.isDirectory()) accessSync(projectPath, constants.R_OK);","typeGuard":"function isErrnoException(error: unknown): error is NodeJS.ErrnoException {\n  return error instanceof Error && typeof (error as NodeJS.ErrnoException).code === 'string';\n}","tryCatchPattern":null,"preventionTips":["Do not run uninstall concurrently with cache-cleaning tools","Keep per-project cache dirs readable by your user","One unreadable project dir only skips that project's logs: check the message path to confirm it matters"],"tags":["uninstall","cache-cleanup","filesystem"],"backgroundTag":"file-read-permission-denied","analyzedSha":"e2d1df569a8f04075d40e92461128ece7cf04c82","analyzedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}