Skip to content

lazycodex-ai doctor fails on Windows: spawn codex ENOENT (npm .cmd/.ps1 shims not resolvable without shell) #138

Description

@innopoiesis

Environment

  • Windows 11 Pro (10.0.26200), Node v24.13.1, npm 11.12.1
  • lazycodex-ai@4.19.0, Codex CLI 0.144.1 installed globally via npm (codex.ps1 / codex.cmd shims on PATH)

Symptom

> npx --yes lazycodex-ai@4.19.0 doctor
spawn codex ENOENT
(exit 1)

codex itself runs fine from PowerShell/cmd/Git Bash.

Root cause

On Windows, npm global installs expose codex only as codex.cmd / codex.ps1 shims. child_process.spawn("codex", ...) without shell: true (or without resolving the full shim path / using where codex) cannot execute .cmd/.ps1 files and fails with ENOENT. Doctor therefore cannot produce its health report on Windows even when Codex is correctly installed.

Suggested fix

Resolve the executable first (e.g. try codex.cmd on process.platform === "win32", or use a cross-platform launcher such as cross-spawn), or spawn with { shell: true } for the doctor probe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions