{"record":{"id":"7dd623bb5d9fffd5","repo":"thedotmack/claude-mem","slug":"ctx-component-failed-during-ctx-phase-cau","errorCode":null,"errorMessage":"${ctx.component} failed during ${ctx.phase}: ${causeMessage(ctx.cause)}","messagePattern":"(.+?) failed during (.+?): (.+?)","errorType":"exception","errorClass":"InstallAbortError","httpStatus":null,"severity":"critical","filePath":"src/npx-cli/install/error-reporter.ts","lineNumber":123,"sourceCode":" * The single decision point. ABORT throws InstallAbortError (the top-level\n * handler prints + exits 1). Every other severity records to the summary and\n * returns.\n */\nexport function installerError(\n  severity: ErrorSeverity,\n  ctx: ErrorContext,\n  summary: InstallSummary,\n): void {\n  const dataDir = resolveDataDir();\n  const category = classifyError(ctx.cause, { component: ctx.component, phase: ctx.phase });\n  const remediation =\n    ctx.remediation ??\n    category.remediation({ platform: process.platform, dataDir });\n\n  switch (severity) {\n    case ErrorSeverity.ABORT: {\n      writeLastInstallError(category, ctx, remediation, dataDir);\n      throw new InstallAbortError(\n        `${ctx.component} failed during ${ctx.phase}: ${causeMessage(ctx.cause)}`,\n        { category, remediation, cause: ctx.cause },\n      );\n    }\n    case ErrorSeverity.FAIL_LOUD_PER_IDE: {\n      const ide = ctx.ide ?? ctx.component;\n      if (!summary.failedIDEs.includes(ide)) summary.failedIDEs.push(ide);\n      summary.warnings.push({\n        component: ide,\n        message: ctx.details ? `${causeMessage(ctx.cause)}\\n${ctx.details}` : causeMessage(ctx.cause),\n        remediation,\n      });\n      return;\n    }\n    case ErrorSeverity.WARN_CONTINUE: {\n      summary.warnings.push({\n        component: ctx.component,\n        message: causeMessage(ctx.cause),","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/npx-cli/install/error-reporter.ts#L105-L141","documentation":"installerError is the central error dispatcher of the installer: it computes a category, remediation, and severity for a failed component, and when severity is ABORT it writes a last-install-error record and throws InstallAbortError with '<component> failed during <phase>: <cause>'. This means a phase of installation failed hard enough that the install cannot continue.","triggerScenarios":"Any installer phase recording a failure via recordFailure or a step like setupIDEs, runNpmInstallInMarketplace, requireWorkerStopped, or validateNonInteractiveProvider escalating to ABORT severity through installerError.","commonSituations":"npm/marketplace install failures, IDE setup errors, a worker still running when it must be stopped, or missing non-interactive provider config — each surfaced as a single wrapped abort.","solutions":["Read the full error: the component, phase, and cause message identify exactly which step failed.","Check the last-install-error record written to the data dir (~/.claude-mem) for remediation steps.","Fix the underlying cause (network, permissions, config) and re-run the install.","Follow the remediation hint included in the error/report, which is computed per category and platform."],"exampleFix":"// before\nnpx claude-mem install   # fails: 'marketplace failed during npm-install: ENOSPC'\n// after\ndf -h   # free disk space, then re-run the installer","handlingStrategy":"try-catch","validationCode":"const lastError = readLastInstallError(dataDir);\nif (lastError) console.log('Previous install failed:', lastError.category, lastError.remediation);","typeGuard":"const isInstallAbort = (e: unknown): e is InstallAbortError => e instanceof InstallAbortError && typeof e.remediation === 'string';","tryCatchPattern":"try {\n  await runInstall();\n} catch (e) {\n  if (e instanceof InstallAbortError) {\n    console.error(`${e.category.label}: ${e.message}\\nFix: ${e.remediation}`);\n    process.exitCode = 1;\n  } else throw e;\n}","preventionTips":["Run the installer with a stable network and sufficient disk space.","Ensure no claude-mem worker is running before installing (requireWorkerStopped).","Set provider credentials before non-interactive installs.","Read the remediation hint in the error output before retrying blindly."],"tags":["installer","abort","wrapped-error"],"backgroundTag":"internal-invariant-violation","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"}