thedotmack/claude-mem · warning
ERESOLVE
ERESOLVE
Error message
npm reported an ERESOLVE peer-dependency conflict in marketplace deps; retrying once with --legacy-peer-deps.
What it means
While installing marketplace plugin dependencies, `npm install` failed with exit != 0 and stderr containing ERESOLVE — npm's peer-dependency resolver found incompatible peer ranges (classically tree-sitter). The installer logs this warning and retries exactly once with `--legacy-peer-deps`; a strict failure WITHOUT ERESOLVE aborts instead.
Source
Thrown at src/npx-cli/commands/install.ts:786
component: 'marketplace-npm-install',
phase: 'marketplace-deps',
cause: new Error('npm install timed out'),
details: strictResult.stderr.slice(0, 4000),
}, summary);
}
if (!isEresolve(strictResult.stderr)) {
// A strict failure with no ERESOLVE is a real bug — never retry, ABORT.
installerError(ErrorSeverity.ABORT, {
component: 'marketplace-npm-install',
phase: 'marketplace-deps',
cause: new Error(`npm install failed (exit ${strictResult.code})`),
details: strictResult.stderr.slice(0, 4000),
}, summary);
}
// Confirmed ERESOLVE — log loudly, attempt one fallback with --legacy-peer-deps.
log.warn('npm reported an ERESOLVE peer-dependency conflict in marketplace deps; retrying once with --legacy-peer-deps.');
log.warn(extractEresolveBlock(strictResult.stderr));
const legacyResult = await runNpmStrict(marketplaceDir, [...baseFlags, '--legacy-peer-deps']);
if (legacyResult.code === 0) {
summary.warnings.push({
component: 'marketplace-npm-install',
message: 'tree-sitter peer-dep ERESOLVE was resolved with the --legacy-peer-deps fallback. Benign for the marketplace install; re-evaluate when tree-sitter peer ranges change.',
remediation: 'No action required.',
});
return;
}
installerError(ErrorSeverity.ABORT, {
component: 'marketplace-npm-install',
phase: 'marketplace-deps',
cause: new Error(`npm install --legacy-peer-deps still failed (exit ${legacyResult.code}): ERESOLVE`),
details: legacyResult.stderr.slice(0, 4000),
}, summary);View on GitHub (pinned to 8bc631a71a)
Solutions
- Do nothing if the fallback succeeds — the summary records it as a benign warning with no action required.
- Update to the latest claude-mem patch release where peer ranges are re-evaluated (`npx claude-mem@latest install`).
- Delete the marketplace node_modules and package-lock.json, then rerun install to get a clean resolution.
- If the legacy retry also fails, capture `extractEresolveBlock` output and report which peer range conflicts; pin the offending package manually.
Example fix
# before: strict install fails npm install # ERESOLVE peer conflict on tree-sitter # after: the installer's own fallback npm install --legacy-peer-deps
Defensive patterns
Strategy: retry
Validate before calling
// Detect ERESOLVE before deciding to retry (mirror of isEresolve):
const isEresolve = (stderr: string): boolean => /ERESOLVE/.test(stderr);
const r = spawnSync('npm', ['install', ...flags], { encoding: 'utf8' });
if (r.status !== 0 && isEresolve(r.stderr)) {
// retry ONCE with --legacy-peer-deps; abort on any other failure
} Prevention
- Keep npm and Node current — older resolvers produce spurious ERESOLVE on modern peer ranges.
- Never retry non-ERESOLVE failures with --legacy-peer-deps; that masks real bugs.
- Delete stale package-lock.json when the tool's dependency graph changes majorly.
- Record every legacy-peer-deps fallback in your release notes so peer-range changes get re-evaluated.
When it happens
Trigger: runNpmStrict on the marketplace dir where the resolved dependency graph violates a peer range — typically a tree-sitter native module whose peer range does not cover the Node/npm-resolved version; also stale package-lock files after a claude-mem version bump.
Common situations: New claude-mem release pulls a tree-sitter update with narrower peer ranges; npm 7+ strict peer resolution on older lockfiles; mixing plugin marketplace deps installed under a different npm major version.
Related errors
- API key prompt cancelled — leaving existing configuration un
- Gateway setup cancelled — leaving existing configuration unt
- Provider=${options.provider} requested non-interactively. AP
- Couldn't reach cmem.ai — start the trial later with npx clau
- No worries — finish anytime: npx claude-mem install
AI-assisted analysis of thedotmack/claude-mem@8bc631a71a (2026-08-20).
Data as JSON: /api/errors/1255100bde5b828b.
Report an issue: GitHub.