bmad-code-org/BMAD-METHOD · error · Error

${label} is not readable: ${filePath}

Error message

${label} is not readable: ${filePath}

What it means

Thrown by assertReadableFile when the file exists and is a regular file but fs.access with R_OK fails — the process cannot read it. Isolates a pure permission problem on a file.

Source

Thrown at tools/installer/core/install-paths.js:103

  try {
    await fs.access(dirPath, fs.constants.R_OK);
  } catch {
    throw new Error(`${label} is not readable: ${dirPath}`);
  }
}

async function assertReadableFile(filePath, label) {
  const stat = await fs.stat(filePath).catch(() => null);
  if (!stat) {
    throw new Error(`${label} does not exist: ${filePath}`);
  }
  if (!stat.isFile()) {
    throw new Error(`${label} is not a file: ${filePath}`);
  }
  try {
    await fs.access(filePath, fs.constants.R_OK);
  } catch {
    throw new Error(`${label} is not readable: ${filePath}`);
  }
}

async function ensureWritableDir(dirPath, label) {
  const stat = await fs.stat(dirPath).catch(() => null);
  if (stat && !stat.isDirectory()) {
    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}`);
    }

View on GitHub (pinned to b70486b9bd)

Solutions

  1. Make the file readable: `chmod +r <filePath>`.
  2. Run the installer as the file owner.
  3. Adjust container/sandbox mount options to permit reads.
Defensive patterns

Strategy: validation

Validate before calling

await fs.access(filePath, fs.constants.R_OK);

Try / catch

try {
  await assertReadableFile(filePath, label);
} catch (error) {
  if (error.message.includes('is not readable')) { /* fix perms */ }
  throw error;
}

Prevention

When it happens

Trigger: assertReadableFile runs against package.json (or another required file) and the OS denies read access to the current user.

Common situations: File owned by another user with no world-read bit, restrictive umask, or a sandboxed environment that masks the file.

Related errors


AI-assisted analysis of bmad-code-org/BMAD-METHOD@b70486b9bd (2026-08-13). Data as JSON: /api/errors/819fc6eecda55c94. Report an issue: GitHub.