corebrain setup fails on Windows: "docker not found on PATH" when Docker is installed
Description
Running corebrain setup on Windows immediately fails with:
■ `docker` not found on PATH. Install Docker Desktop (or the docker engine) and retry.
This occurs even when Docker Desktop is installed and docker is accessible from the terminal (e.g., Git Bash, PowerShell, CMD).
Root Cause
The commandExists helper in the setup utilities uses command -v to check whether a binary is on PATH:
async function commandExists(cmd: string): Promise<boolean> {
try {
await exec(`command -v ${cmd}`);
return true;
} catch {
return false;
}
}
command -v is a POSIX shell builtin. On Windows, Node.js's child_process.exec() uses cmd.exe (via the ComSpec environment variable), which does not recognize command. The call silently fails, commandExists returns false, and the setup aborts.
The same function exists in at least three files:
apps/cli/src/utils/setup/local.ts
apps/cli/src/utils/setup/docker.ts
apps/cli/src/utils/setup/railway.ts
Environment
- OS: Windows (11, Git Bash / MSYS2 shell)
- Node.js: v25.9.0
- @redplanethq/corebrain: 2.8.30
- Docker Desktop: 29.5.3 (installed at
C:\Program Files\Docker\Docker\resources\bin\)
Steps to Reproduce
- Install Docker Desktop on Windows.
npm install -g @redplanethq/corebrain
corebrain setup
- Observe the error.
Suggested Fix
Use where on Windows and command -v on POSIX:
async function commandExists(cmd: string): Promise<boolean> {
try {
await exec(`${process.platform === 'win32' ? 'where' : 'command -v'} ${cmd}`);
return true;
} catch {
return false;
}
}
Workaround
- Patch the installed files manually (re-applied after each
npm install -g):
# In each of:
# %APPDATA%\npm\node_modules\@redplanethq\corebrain\dist\utils\setup\local.js
# %APPDATA%\npm\node_modules\@redplanethq\corebrain\dist\utils\setup\docker.js
# %APPDATA%\npm\node_modules\@redplanethq\corebrain\dist\utils\setup\railway.js
# Replace:
# await exec(`command -v ${cmd}`)
# With:
# await exec(`${process.platform === "win32" ? "where" : "command -v"} ${cmd}`)
- Alternatively, ensure
SHELL env var points to a POSIX shell (e.g., Git Bash's /usr/bin/sh) — though this is fragile.
Affected Files (source)
apps/cli/src/utils/setup/local.ts
apps/cli/src/utils/setup/docker.ts
apps/cli/src/utils/setup/railway.ts
The same commandExists function pattern is used in all three files, so a single fix applied to a shared utility would prevent the duplication.
corebrain setupfails on Windows: "dockernot found on PATH" when Docker is installedDescription
Running
corebrain setupon Windows immediately fails with:This occurs even when Docker Desktop is installed and
dockeris accessible from the terminal (e.g., Git Bash, PowerShell, CMD).Root Cause
The
commandExistshelper in the setup utilities usescommand -vto check whether a binary is on PATH:command -vis a POSIX shell builtin. On Windows, Node.js'schild_process.exec()usescmd.exe(via theComSpecenvironment variable), which does not recognizecommand. The call silently fails,commandExistsreturnsfalse, and the setup aborts.The same function exists in at least three files:
apps/cli/src/utils/setup/local.tsapps/cli/src/utils/setup/docker.tsapps/cli/src/utils/setup/railway.tsEnvironment
C:\Program Files\Docker\Docker\resources\bin\)Steps to Reproduce
npm install -g @redplanethq/corebraincorebrain setupSuggested Fix
Use
whereon Windows andcommand -von POSIX:Workaround
npm install -g):SHELLenv var points to a POSIX shell (e.g., Git Bash's/usr/bin/sh) — though this is fragile.Affected Files (source)
apps/cli/src/utils/setup/local.tsapps/cli/src/utils/setup/docker.tsapps/cli/src/utils/setup/railway.tsThe same
commandExistsfunction pattern is used in all three files, so a single fix applied to a shared utility would prevent the duplication.