{"record":{"id":"1255100bde5b828b","repo":"thedotmack/claude-mem","slug":"eresolve","errorCode":"ERESOLVE","errorMessage":"npm reported an ERESOLVE peer-dependency conflict in marketplace deps; retrying once with --legacy-peer-deps.","messagePattern":"npm reported an ERESOLVE peer-dependency conflict in marketplace deps; retrying once with --legacy-peer-deps\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/npx-cli/commands/install.ts","lineNumber":786,"sourceCode":"      component: 'marketplace-npm-install',\n      phase: 'marketplace-deps',\n      cause: new Error('npm install timed out'),\n      details: strictResult.stderr.slice(0, 4000),\n    }, summary);\n  }\n\n  if (!isEresolve(strictResult.stderr)) {\n    // A strict failure with no ERESOLVE is a real bug — never retry, ABORT.\n    installerError(ErrorSeverity.ABORT, {\n      component: 'marketplace-npm-install',\n      phase: 'marketplace-deps',\n      cause: new Error(`npm install failed (exit ${strictResult.code})`),\n      details: strictResult.stderr.slice(0, 4000),\n    }, summary);\n  }\n\n  // Confirmed ERESOLVE — log loudly, attempt one fallback with --legacy-peer-deps.\n  log.warn('npm reported an ERESOLVE peer-dependency conflict in marketplace deps; retrying once with --legacy-peer-deps.');\n  log.warn(extractEresolveBlock(strictResult.stderr));\n\n  const legacyResult = await runNpmStrict(marketplaceDir, [...baseFlags, '--legacy-peer-deps']);\n  if (legacyResult.code === 0) {\n    summary.warnings.push({\n      component: 'marketplace-npm-install',\n      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.',\n      remediation: 'No action required.',\n    });\n    return;\n  }\n\n  installerError(ErrorSeverity.ABORT, {\n    component: 'marketplace-npm-install',\n    phase: 'marketplace-deps',\n    cause: new Error(`npm install --legacy-peer-deps still failed (exit ${legacyResult.code}): ERESOLVE`),\n    details: legacyResult.stderr.slice(0, 4000),\n  }, summary);","sourceCodeStart":768,"sourceCodeEnd":804,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/8bc631a71a487424b866756e43a6efa4574cc66b/src/npx-cli/commands/install.ts#L768-L804","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before: strict install fails\nnpm install  # ERESOLVE peer conflict on tree-sitter\n# after: the installer's own fallback\nnpm install --legacy-peer-deps","handlingStrategy":"retry","validationCode":"// Detect ERESOLVE before deciding to retry (mirror of isEresolve):\nconst isEresolve = (stderr: string): boolean => /ERESOLVE/.test(stderr);\nconst r = spawnSync('npm', ['install', ...flags], { encoding: 'utf8' });\nif (r.status !== 0 && isEresolve(r.stderr)) {\n  // retry ONCE with --legacy-peer-deps; abort on any other failure\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["npm","install","peer-dependency","eresolve","tree-sitter"],"backgroundTag":"npm-eresolve-peer-conflict","analyzedSha":"8bc631a71a487424b866756e43a6efa4574cc66b","analyzedAt":"2026-08-20T23:58:13.836Z","contentChangedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}