thedotmack/claude-mem · warning

npm reported an ERESOLVE peer-dependency conflict in…

Error message

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)

What it means

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.

Solutions

  1. Let the automatic --legacy-peer-deps retry finish — if it succeeds the install completes with a recorded warning.
  2. Update the marketplace deps / tree-sitter peer ranges (`npm update` in the marketplace dir) to resolve the conflict properly.
  3. Use a Node/npm version compatible with tree-sitter's peer ranges.
  4. Manually run `npm install --legacy-peer-deps` in the marketplace directory to inspect the full conflict output.
  5. Pin tree-sitter versions if the conflict recurs across installs.

Example fix

// before
npm install
// after (fallback / proper fix)
npm install --legacy-peer-deps
// or: upgrade the package whose peer range conflicts
cd <marketplaceDir> && npm update tree-sitter
Defensive patterns

Strategy: retry

Validate before calling

// detect the conflict before/around install
const result = await runNpmStrict(marketplaceDir, baseFlags);
if (result.code !== 0 && /ERESOLVE/.test(result.stderr)) {
  console.warn('ERESOLVE detected; will retry with --legacy-peer-deps');
}

Try / catch

const legacyResult = await runNpmStrict(marketplaceDir, [...baseFlags, '--legacy-peer-deps']);
if (legacyResult.code === 0) {
  summary.warnings.push({ component: 'marketplace-npm-install', message: 'ERESOLVE resolved via --legacy-peer-deps fallback' });
} else {
  log.error(legacyResult.stderr.slice(0, 4000));
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/14936241eb21b85a. Report an issue: GitHub.

Appendix: source

Thrown at src/npx-cli/commands/install.ts:810

      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 d8bc9755e7)