{"record":{"id":"870a6638f2f1f77d","repo":"thedotmack/claude-mem","slug":"npm-reported-an-eresolve-peer-dependency-conflict-in-install","errorCode":null,"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":809,"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":791,"sourceCodeEnd":827,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/npx-cli/commands/install.ts#L791-L827","documentation":"The installer runs a strict `npm install` in the marketplace directory. When it fails with an ERESOLVE peer-dependency conflict, the installer logs this warning, prints the extracted ERESOLVE block, and retries exactly once with `--legacy-peer-deps` (which skips peer-resolution enforcement).","triggerScenarios":"`runNpmStrict(marketplaceDir, baseFlags)` exits non-zero with stderr containing an ERESOLVE block — e.g. marketplace plugin packages demanding incompatible peer versions of a shared dependency.","commonSituations":"Plugins in the marketplace pinning peerDependencies to older/newer major versions than what's resolvable; npm 7+ strict peer resolution vs packages built for npm 6; mixed versions of claude plugin deps.","solutions":["Let the installer's automatic --legacy-peer-deps retry complete — it usually resolves the conflict.","Run `npm install --legacy-peer-deps` manually inside the marketplace directory to inspect/fix the tree.","Update or remove the offending plugin package whose peerDependencies conflict, then rerun the installer.","Use an npm override in package.json to force a compatible peer version."],"exampleFix":"// before\nnpm install\n// after\nnpm install --legacy-peer-deps","handlingStrategy":"retry","validationCode":"npm ls --all 2>&1 | grep -i 'ERESOLVE\\|peer' || echo 'peer deps OK'","typeGuard":null,"tryCatchPattern":"try {\n  runNpmStrict(marketplaceDir, baseFlags);\n} catch (e) {\n  if (String(e.details).includes('ERESOLVE')) {\n    runNpmStrict(marketplaceDir, [...baseFlags, '--legacy-peer-deps']);\n  } else { throw e; }\n}","preventionTips":["Pre-install with --legacy-peer-deps when marketplace plugins pin conflicting peer versions.","Keep plugin packages updated so peerDependency ranges stay compatible.","Use npm overrides in package.json to pin shared deps to a single compatible version."],"tags":["npm","peer-dependencies","install","eresolve"],"backgroundTag":"dependency-conflict","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}