{"record":{"id":"03ff76f331d6bb22","repo":"bmad-code-org/BMAD-METHOD","slug":"label-does-not-exist-filepath","errorCode":null,"errorMessage":"${label} does not exist: ${filePath}","messagePattern":"(.+?) does not exist: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"tools/installer/core/install-paths.js","lineNumber":95,"sourceCode":"async function assertReadableDir(dirPath, label) {\n  const stat = await fs.stat(dirPath).catch(() => null);\n  if (!stat) {\n    throw new Error(`${label} does not exist: ${dirPath}`);\n  }\n  if (!stat.isDirectory()) {\n    throw new Error(`${label} is not a directory: ${dirPath}`);\n  }\n  try {\n    await fs.access(dirPath, fs.constants.R_OK);\n  } catch {\n    throw new Error(`${label} is not readable: ${dirPath}`);\n  }\n}\n\nasync function assertReadableFile(filePath, label) {\n  const stat = await fs.stat(filePath).catch(() => null);\n  if (!stat) {\n    throw new Error(`${label} does not exist: ${filePath}`);\n  }\n  if (!stat.isFile()) {\n    throw new Error(`${label} is not a file: ${filePath}`);\n  }\n  try {\n    await fs.access(filePath, fs.constants.R_OK);\n  } catch {\n    throw new Error(`${label} is not readable: ${filePath}`);\n  }\n}\n\nasync function ensureWritableDir(dirPath, label) {\n  const stat = await fs.stat(dirPath).catch(() => null);\n  if (stat && !stat.isDirectory()) {\n    throw new Error(`${label} exists but is not a directory: ${dirPath}`);\n  }\n\n  try {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/bmad-code-org/BMAD-METHOD/blob/b70486b9bdcb0a404d329e2a763b57964e7f1360/tools/installer/core/install-paths.js#L77-L113","documentation":"Thrown by assertReadableFile when fs.stat resolves to null — the expected file does not exist. Used to validate required files such as package.json (label 'package.json') inside the BMAD source root before reading them.","triggerScenarios":"InstallPaths.create() calls assertReadableFile(pkgPath, 'package.json') and the resolved source root has no package.json. Reachable for any caller validating a required readable file.","commonSituations":"Corrupted or partial checkout missing package.json, running from a directory that is not a real BMAD source tree, or a packaging defect that omitted package.json.","solutions":["Confirm the file exists: `ls <filePath>`.","Re-clone or reinstall the BMAD package so required files are present.","If you control getProjectRoot(), ensure it points at the directory containing package.json."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!(await fs.pathExists(filePath))) {\n  throw new Error(`Missing required file: ${filePath}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await assertReadableFile(filePath, label);\n} catch (error) {\n  if (error.message.endsWith(`does not exist: ${filePath}`)) { /* missing file */ }\n  throw error;\n}","preventionTips":["Ship package.json and other required files in every package build.","Validate the source tree integrity before running install."],"tags":["filesystem","precondition","installer"],"backgroundTag":null,"analyzedSha":"b70486b9bdcb0a404d329e2a763b57964e7f1360","analyzedAt":"2026-08-13T01:21:12.247Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}