{"record":{"id":"b04c6d14f240934c","repo":"bmad-code-org/BMAD-METHOD","slug":"label-no-space-left-on-device-dirpath","errorCode":null,"errorMessage":"${label}: no space left on device: ${dirPath}","messagePattern":"(.+?): no space left on device: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"tools/installer/core/install-paths.js","lineNumber":120,"sourceCode":"  } 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 {\n    await fs.ensureDir(dirPath);\n  } catch (error) {\n    if (error.code === 'EACCES') {\n      throw new Error(`${label}: permission denied creating directory: ${dirPath}`);\n    }\n    if (error.code === 'ENOSPC') {\n      throw new Error(`${label}: no space left on device: ${dirPath}`);\n    }\n    throw new Error(`${label}: cannot create directory: ${dirPath} (${error.message})`);\n  }\n\n  try {\n    await fs.access(dirPath, fs.constants.R_OK | fs.constants.W_OK);\n  } catch {\n    throw new Error(`${label} is not writable: ${dirPath}`);\n  }\n}\n\nmodule.exports = { InstallPaths };\n","sourceCodeStart":102,"sourceCodeEnd":133,"githubUrl":"https://github.com/bmad-code-org/BMAD-METHOD/blob/b70486b9bdcb0a404d329e2a763b57964e7f1360/tools/installer/core/install-paths.js#L102-L133","documentation":"Thrown by ensureWritableDir when fs.ensureDir fails with ENOSPC — the filesystem is out of space. Distinct from permission errors so the user knows the volume is full.","triggerScenarios":"InstallPaths.create() invokes ensureDir for the project root or _bmad subdirectories and the underlying disk/volume has no free blocks/inodes.","commonSituations":"Full disk, exhausted inode table, or a quota-limited filesystem.","solutions":["Free space on the target volume: remove unneeded files.","Choose a target directory on a filesystem with free space.","If under a quota, raise the quota or clean up to comply."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { statfs } from 'node:fs/promises';\nconst info = await statfs(targetParent).catch(() => null);\n// inspect free blocks before attempting a large install","typeGuard":null,"tryCatchPattern":"try {\n  await ensureWritableDir(dirPath, label);\n} catch (error) {\n  if (error.message.includes('no space left on device')) { /* free space or relocate */ }\n  throw error;\n}","preventionTips":["Check free disk space before running a multi-module install.","Run installs on volumes with adequate headroom."],"tags":["filesystem","disk-space","precondition","installer"],"backgroundTag":null,"analyzedSha":"b70486b9bdcb0a404d329e2a763b57964e7f1360","analyzedAt":"2026-08-13T01:21:12.247Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}