thedotmack/claude-mem · info

Claude Code is not installed. Claude-mem works best in…

Error message

Claude Code is not installed. Claude-mem works best in Claude Code, but also works with the IDEs below.

What it means

During `claude-mem install`, promptForIDESelection detects installed IDEs; when Claude Code is present but not detected as installed, it logs this notice and prompts the user to either install Claude Code, pick another IDE, or cancel — because claude-mem works best in Claude Code.

Solutions

  1. Install Claude Code (npm install -g @anthropic-ai/claude-code) and re-run the installer
  2. Ensure the npm global bin dir is on PATH (`npm config get prefix`/bin)
  3. Choose 'skip' at the prompt to select another supported IDE instead
  4. Choose 'install' at the prompt to let the installer install Claude Code automatically

Example fix

// before
$ npx claude-mem install
# claude not on PATH -> warning shown
// after
$ npm install -g @anthropic-ai/claude-code
$ npx claude-mem install   # claude-code detected, warning gone
Defensive patterns

Strategy: validation

Validate before calling

if (spawnSync('claude', ['--version']).status !== 0) {
  console.warn('Claude Code not detected; it will be offered during install');
}

Type guard

function isClaudeCodeDetected(ides: DetectedIDE[]): boolean {
  return ides.some(i => i.id === 'claude-code' && i.detected);
}

Try / catch

try {
  const ides = await promptForIDESelection();
} catch (e) {
  if (e instanceof Error && e.message.includes('cancel')) {
    // user aborted installation
  }
}

Prevention

When it happens

Trigger: detectInstalledIDEs() returns an entry with id 'claude-code' whose detected flag is false: the claude executable is not found on PATH while running the installer.

Common situations: Claude Code not yet installed on the machine; installed via a version manager whose PATH is not active in the installer shell; npm global bin directory not on PATH; corrupted/partial Claude Code installation.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


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

Appendix: source

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

      if (!IS_WINDOWS) {
        try {
          applyClaudeCodePathSetupIfNeeded();
        } catch (error: unknown) {
          // [ANTI-PATTERN IGNORED]: the failure is already surfaced to the user via the interactive-aware log.warn wrapper below (p.log.warn in a TTY, console.warn otherwise); PATH setup is best-effort after a successful install.
          log.warn(`Could not auto-apply PATH setup: ${error instanceof Error ? error.message : String(error)}`);
        }
      }
      resolve(true);
    });
  });
}

async function promptForIDESelection(): Promise<string[]> {
  let detectedIDEs = detectInstalledIDEs();
  const claudeCodeInfo = detectedIDEs.find((ide) => ide.id === 'claude-code');

  if (claudeCodeInfo && !claudeCodeInfo.detected) {
    log.warn('Claude Code is not installed. Claude-mem works best in Claude Code, but also works with the IDEs below.');
    const choice = await p.select<'install' | 'skip' | 'cancel'>({
      message: 'Install Claude Code now?',
      options: [
        { value: 'install', label: 'Yes — install Claude Code (recommended)' },
        { value: 'skip', label: 'No — pick another IDE below' },
        { value: 'cancel', label: 'Cancel installation' },
      ],
      initialValue: 'install',
    });
    if (p.isCancel(choice) || choice === 'cancel') {
      p.cancel('Installation cancelled.');
      process.exit(0);
    }
    if (choice === 'install') {
      if (await installClaudeCode()) {
        detectedIDEs = detectInstalledIDEs();
      }
    }

View on GitHub (pinned to d8bc9755e7)