bmad-code-org/BMAD-METHOD · error · Error
${label} is not writable: ${dirPath}
Error message
${label} is not writable: ${dirPath} What it means
Thrown by ensureWritableDir after the directory exists (or was just created) but fs.access with R_OK|W_OK fails — the process cannot write to it. Catches the case where the directory is present yet not writable by the current user.
Source
Thrown at tools/installer/core/install-paths.js:128
throw new Error(`${label} exists but is not a directory: ${dirPath}`);
}
try {
await fs.ensureDir(dirPath);
} catch (error) {
if (error.code === 'EACCES') {
throw new Error(`${label}: permission denied creating directory: ${dirPath}`);
}
if (error.code === 'ENOSPC') {
throw new Error(`${label}: no space left on device: ${dirPath}`);
}
throw new Error(`${label}: cannot create directory: ${dirPath} (${error.message})`);
}
try {
await fs.access(dirPath, fs.constants.R_OK | fs.constants.W_OK);
} catch {
throw new Error(`${label} is not writable: ${dirPath}`);
}
}
module.exports = { InstallPaths };
View on GitHub (pinned to b70486b9bd)
Solutions
- Take ownership / grant write: `chown` or `chmod +w <dirPath>`.
- Choose a target the current user fully owns.
- If read-only mount, remount read-write or relocate the target.
Defensive patterns
Strategy: validation
Validate before calling
await fs.access(dirPath, fs.constants.R_OK | fs.constants.W_OK);
Try / catch
try {
await ensureWritableDir(dirPath, label);
} catch (error) {
if (error.message.includes('is not writable')) { /* fix ownership/perms */ }
throw error;
} Prevention
- Ensure the installer runs as the owner of the target directory.
- Avoid read-only mounts for install targets.
When it happens
Trigger: InstallPaths.create() successfully resolves/creates the project root or a _bmad subdirectory, but the final R_OK|W_OK access check fails (e.g. directory owned by another user, read-only mount).
Common situations: Directory created by root but installer runs as a normal user, a read-only filesystem mount, ACLs denying write, or a parent that allows mkdir but not subsequent writes.
Related errors
- ${label} is not readable: ${dirPath}
- ${label} is not readable: ${filePath}
- ${label}: permission denied creating directory: ${dirPath}
- ${label} does not exist: ${dirPath}
- ${label} is not a directory: ${dirPath}
AI-assisted analysis of bmad-code-org/BMAD-METHOD@b70486b9bd (2026-08-13).
Data as JSON: /api/errors/888a4165eddbbe1f.
Report an issue: GitHub.