thedotmack/claude-mem · warning
[uninstall] Could not read ${projectPath}:
Error message
[uninstall] Could not read ${projectPath}: What it means
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.
Source
Thrown at src/npx-cli/commands/uninstall.ts:210
}
}
}
const cacheRoot = join(home, '.cache', 'claude-cli-nodejs');
if (existsSync(cacheRoot)) {
let projectDirs: string[] = [];
try {
projectDirs = readdirSync(cacheRoot);
} catch (error: unknown) {
console.warn(`[uninstall] Could not read ${cacheRoot}:`, error instanceof Error ? error.message : String(error));
}
for (const projectDir of projectDirs) {
const projectPath = join(cacheRoot, projectDir);
let logEntries: string[] = [];
try {
logEntries = readdirSync(projectPath);
} catch (error: unknown) {
console.warn(`[uninstall] Could not read ${projectPath}:`, error instanceof Error ? error.message : String(error));
continue;
}
for (const entry of logEntries) {
if (!entry.startsWith('mcp-logs-plugin-claude-mem-')) continue;
const logPath = join(projectPath, entry);
try {
rmSync(logPath, { recursive: true, force: true });
removedCount++;
} catch (error: unknown) {
console.warn(`[uninstall] Could not remove ${logPath}:`, error instanceof Error ? error.message : String(error));
}
}
}
}
const pluginDataDir = join(home, '.claude', 'plugins', 'data', 'claude-mem-thedotmack');
if (existsSync(pluginDataDir)) {
try {View on GitHub (pinned to e2d1df569a)
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
Defensive patterns
Strategy: validation
Validate before calling
import { statSync, accessSync, constants } from 'node:fs';
// Skip entries that are not readable directories before handing them to a sweep
const st = statSync(projectPath);
if (st.isDirectory()) accessSync(projectPath, constants.R_OK); Type guard
function isErrnoException(error: unknown): error is NodeJS.ErrnoException {
return error instanceof Error && typeof (error as NodeJS.ErrnoException).code === 'string';
} Prevention
- 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
When it happens
Trigger: `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).
Common situations: Per-project directories created under different credentials; cleanup tools (bleachbit, CCleaner) deleting cache contents while uninstall runs.
Related errors
- [uninstall] Could not read ${cacheRoot}:
- [uninstall] Could not write settings during server runtime c
- [uninstall] Could not read ${filePath}:
- [uninstall] Could not read ${npxRoot}:
- [uninstall] Could not remove ${logPath}:
AI-assisted analysis of thedotmack/claude-mem@e2d1df569a (2026-08-20).
Data as JSON: /api/errors/f8d3e894156ce066.
Report an issue: GitHub.