{"record":{"id":"53e03fe2cbfaf187","repo":"bmad-code-org/BMAD-METHOD","slug":"label-does-not-exist-dirpath","errorCode":null,"errorMessage":"${label} does not exist: ${dirPath}","messagePattern":"(.+?) does not exist: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"tools/installer/core/install-paths.js","lineNumber":80,"sourceCode":"  }\n  filesManifest() {\n    return path.join(this.configDir, 'files-manifest.csv');\n  }\n  helpCatalog() {\n    return path.join(this.configDir, 'bmad-help.csv');\n  }\n  moduleDir(name) {\n    return path.join(this.bmadDir, name);\n  }\n  moduleConfig(name) {\n    return path.join(this.bmadDir, name, 'config.yaml');\n  }\n}\n\nasync 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}`);","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/bmad-code-org/BMAD-METHOD/blob/b70486b9bdcb0a404d329e2a763b57964e7f1360/tools/installer/core/install-paths.js#L62-L98","documentation":"Thrown by assertReadableDir when fs.stat resolves to null, i.e. the directory path does not exist on disk. The helper is an internal precondition check used by InstallPaths.create to validate paths like the BMAD source root before any install work begins.","triggerScenarios":"InstallPaths.create() runs assertReadableDir(srcDir, 'BMAD source root') where srcDir = getProjectRoot(); the resolved source root does not exist. Also reachable if a future caller passes a non-existent directory to assertReadableDir.","commonSituations":"Running the installer from a checkout where the package root was moved/deleted, a broken symlink to the BMAD source, or running against a stale global install whose source tree is gone.","solutions":["Verify the BMAD source checkout is intact: `ls <srcDir>` should list package.json and src/.","Reinstall the BMAD package / re-clone the repo so getProjectRoot() resolves to a real directory.","If running from a global install, reinstall it globally."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const fs = require('../fs-native');\nif (!(await fs.pathExists(dirPath))) {\n  throw new Error(`Config error: expected directory missing: ${dirPath}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await assertReadableDir(dirPath, label);\n} catch (error) {\n  if (error.message.endsWith(`does not exist: ${dirPath}`)) {\n    // handle missing directory\n  }\n  throw error;\n}","preventionTips":["Pre-validate that required directories exist before invoking InstallPaths.create.","In tests, create the source root with real directories rather than mocking stat."],"tags":["filesystem","precondition","installer"],"backgroundTag":null,"analyzedSha":"b70486b9bdcb0a404d329e2a763b57964e7f1360","analyzedAt":"2026-08-13T01:21:12.247Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}