eyaltoledano/claude-task-master · error
Git is not installed or not accessible: ${errorMessage}
Error message
Git is not installed or not accessible: ${errorMessage} What it means
Plain Error thrown by GitAdapter.validateGitInstallation when the underlying `git version()` call (via simple-git) rejects — meaning the git binary is missing, not on PATH, or otherwise unexecutable. The original message from simple-git/Node (ENOENT, EACCES, spawn failure) is embedded after the prefix.
Source
Thrown at packages/tm-core/src/modules/git/adapters/git-adapter.ts:96
/**
* Validates that git is installed and accessible.
* Checks git binary availability and version.
*
* @returns {Promise<void>}
* @throws {Error} If git is not installed or not accessible
*
* @example
* await git.validateGitInstallation();
* console.log('Git is installed');
*/
async validateGitInstallation(): Promise<void> {
try {
await this.git.version();
} catch (error) {
const errorMessage =
error instanceof Error ? error.message : String(error);
throw new Error(
`Git is not installed or not accessible: ${errorMessage}`
);
}
}
/**
* Gets the git version information.
*
* @returns {Promise<{major: number, minor: number, patch: number, agent: string}>}
*
* @example
* const version = await git.getGitVersion();
* console.log(`Git version: ${version.major}.${version.minor}.${version.patch}`);
*/
async getGitVersion(): Promise<{
major: number;
minor: number;
patch: number;View on GitHub (pinned to c0c98d367c)
Solutions
- Install git (`apt-get install git`, `apk add git`, `brew install git`, or winget/choco on Windows)
- Verify with `git --version` in the same shell/environment the app runs in
- Fix PATH so the git binary directory is included (especially for GUI-launched processes or containers)
- Check the embedded cause message: ENOENT means not found, EACCES means permission denied on the binary
- Point simple-git at an explicit git binary path if git lives in a non-standard location
Example fix
// Dockerfile before FROM node:20-alpine // after FROM node:20-alpine RUN apk add --no-cache git
Defensive patterns
Strategy: validation
Validate before calling
import { execFile } from 'child_process';
import { promisify } from 'util';
const run = promisify(execFile);
try {
await run('git', ['--version']);
} catch {
throw new Error('git binary not found on PATH; install git first');
} Type guard
function isSpawnError(e: unknown): e is NodeJS.ErrnoException {
return e instanceof Error && ('code' in e || 'errno' in e);
} Try / catch
try {
await git.validateGitInstallation();
} catch (e) {
console.error(e.message); // includes the underlying spawn/ENOENT detail
process.exitCode = 1; // or disable git-dependent features
} Prevention
- Install git in Docker images (apk add git / apt-get install git)
- Run `git --version` as a startup health check in CLI entry points
- Ensure PATH includes git for GUI-launched and spawned processes
- Document git as a hard runtime dependency of your tool
When it happens
Trigger: Calling validateGitInstallation() on a machine without git installed; git present but not on PATH (minimal Docker images, CI containers); a corrupted or permission-denied git binary; broken PATH inside spawned processes or GUI-launched apps.
Common situations: Dockerfile based on alpine/slim without `apk add git` / `apt-get install git`; CI runners with restricted PATH; macOS apps launched from Finder missing the shell PATH; corporate machines where git install is blocked.
Related errors
- Project path must be an absolute path
- NOT_GIT_REPO
- Not in a git repository, cannot auto-switch tags
- Could not determine current git branch
- Failed to fetch tasks from any tag. First error: ${failedTag
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/e1acea184a37e701.
Report an issue: GitHub.