{"record":{"id":"14936241eb21b85a","repo":"thedotmack/claude-mem","slug":"npm-reported-an-eresolve-peer-dependency-conflict-in","errorCode":null,"errorMessage":"npm reported an ERESOLVE peer-dependency conflict in marketplace deps; retrying once with --legacy-peer-deps. (followed by the extracted ERESOLVE stderr block from extractEresolveBlock)","messagePattern":"npm reported an ERESOLVE peer-dependency conflict in marketplace deps; retrying once with --legacy-peer-deps\\. \\(followed by the extracted ERESOLVE stderr block from extractEresolveBlock\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/npx-cli/commands/install.ts","lineNumber":810,"sourceCode":"      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);\n}","sourceCodeStart":792,"sourceCodeEnd":828,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/npx-cli/commands/install.ts#L792-L828","documentation":"When npm install in the marketplace directory fails with an ERESOLVE peer-dependency conflict (typically tree-sitter peer ranges), the installer logs this warning, prints the extracted ERESOLVE block from stderr, and retries once with --legacy-peer-deps. If the retry succeeds the conflict is recorded as a benign warning in the install summary.","triggerScenarios":"runNpmStrict on the marketplace directory returns a non-zero exit whose stderr matches the ERESOLVE pattern — npm's strict peer-dependency resolver rejects the dependency tree, most often tree-sitter peer ranges not overlapping with the installed npm/node environment.","commonSituations":"Recent npm (7+) enforcing strict peer deps; tree-sitter published new peer ranges; node version upgrade changing the native module compatibility matrix; a lockfile absent so npm resolves fresh versions.","solutions":["Let the automatic --legacy-peer-deps retry finish — if it succeeds the install completes with a recorded warning.","Update the marketplace deps / tree-sitter peer ranges (`npm update` in the marketplace dir) to resolve the conflict properly.","Use a Node/npm version compatible with tree-sitter's peer ranges.","Manually run `npm install --legacy-peer-deps` in the marketplace directory to inspect the full conflict output.","Pin tree-sitter versions if the conflict recurs across installs."],"exampleFix":"// before\nnpm install\n// after (fallback / proper fix)\nnpm install --legacy-peer-deps\n// or: upgrade the package whose peer range conflicts\ncd <marketplaceDir> && npm update tree-sitter","handlingStrategy":"retry","validationCode":"// detect the conflict before/around install\nconst result = await runNpmStrict(marketplaceDir, baseFlags);\nif (result.code !== 0 && /ERESOLVE/.test(result.stderr)) {\n  console.warn('ERESOLVE detected; will retry with --legacy-peer-deps');\n}","typeGuard":null,"tryCatchPattern":"const legacyResult = await runNpmStrict(marketplaceDir, [...baseFlags, '--legacy-peer-deps']);\nif (legacyResult.code === 0) {\n  summary.warnings.push({ component: 'marketplace-npm-install', message: 'ERESOLVE resolved via --legacy-peer-deps fallback' });\n} else {\n  log.error(legacyResult.stderr.slice(0, 4000));\n}","preventionTips":["Keep tree-sitter peer ranges aligned with the Node/npm versions in use.","Commit an up-to-date lockfile so installs resolve reproducibly.","Watch npm major upgrades (npm 7+ strict peer resolution) before rolling out installs.","Read the extracted ERESOLVE block to identify the exact conflicting package and fix the range upstream."],"tags":["npm","peer-dependencies","eresolve","installer"],"backgroundTag":"http-request-failed","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"}