thedotmack/claude-mem · warning
[uninstall] Could not remove ${logPath}:
Error message
[uninstall] Could not remove ${logPath}: What it means
For each mcp-logs-plugin-claude-mem-* entry found in a project cache directory, uninstall runs rmSync(recursive, force) on it. If the removal throws (EACCES/EPERM, EBUSY on Windows), it warns and continues; removedCount is not incremented for that entry.
Source
Thrown at src/npx-cli/commands/uninstall.ts:220
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 {
rmSync(pluginDataDir, { recursive: true, force: true });
removedCount++;
} catch (error: unknown) {
console.warn(`[uninstall] Could not remove ${pluginDataDir}:`, error instanceof Error ? error.message : String(error));
}
}
return removedCount;
}
View on GitHub (pinned to e2d1df569a)
Solutions
- Close Claude CLI sessions and stop MCP servers, then re-run uninstall
- Delete the path from the message manually: rm -rf <logPath>
- Fix ownership under ~/.cache/claude-cli-nodejs if needed
Defensive patterns
Strategy: validation
Validate before calling
import { accessSync, constants } from 'node:fs';
const logDir = `${process.env.HOME}/.cache/claude-cli-nodejs/<project>/mcp-logs-plugin-claude-mem-<id>`;
try { accessSync(logDir, constants.W_OK); }
catch { /* close the Claude/MCP process holding it, then retry uninstall */ } Type guard
function isErrnoException(error: unknown): error is NodeJS.ErrnoException {
return error instanceof Error && typeof (error as NodeJS.ErrnoException).code === 'string';
} Prevention
- Close running Claude CLI sessions before uninstalling so MCP log handles are released
- On Windows, expect EBUSY/EPERM while MCP servers are alive; retry after closing them
- Leftover log dirs are inert: remove them manually if the warning repeats
When it happens
Trigger: `npx claude-mem uninstall` while the Claude CLI or an MCP server child process still holds the log directory or its files open; log files owned by another user; Windows locks on the log files.
Common situations: Uninstalling with a Claude session still running; MCP servers keeping log handles open; log directories written by a root-run process.
Related errors
- [uninstall] Could not remove ${candidate}:
- [uninstall] Could not remove ${pluginDataDir}:
- [uninstall] Could not read ${cacheRoot}:
- [uninstall] Could not read ${projectPath}:
- [uninstall] Could not read selected runtime from settings, d
AI-assisted analysis of thedotmack/claude-mem@e2d1df569a (2026-08-20).
Data as JSON: /api/errors/73e41a001cd0873c.
Report an issue: GitHub.