{"record":{"id":"2533552e1a6a26fb","repo":"gatsbyjs/gatsby","slug":"you-have-not-provided-a-directory-name-for-your-si","errorCode":null,"errorMessage":"You have not provided a directory name for your site. Please do so when running with the 'y' flag.","messagePattern":"You have not provided a directory name for your site\\. Please do so when running with the 'y' flag\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/create-gatsby/src/utils/question-helpers.ts","lineNumber":35,"sourceCode":"  mustSelect = false\n): Array<{ message: string; name: string; disabled?: boolean }> => {\n  const entries = Object.entries(options).map(([name, message]) => {\n    return { name, message: message.message }\n  })\n\n  if (mustSelect) {\n    return entries\n  }\n\n  const none = { name: `none`, message: `No (or I'll add it later)` }\n  const divider = { name: `–`, role: `separator`, message: `–` }\n\n  return [none, divider, ...entries]\n}\n\nexport function validateProjectName(value: string): boolean {\n  if (!value) {\n    reporter.warn(\n      `You have not provided a directory name for your site. Please do so when running with the 'y' flag.`\n    )\n    return false\n  }\n  value = value.trim()\n  if (INVALID_FILENAMES.test(value)) {\n    reporter.warn(\n      `The destination \"${value}\" is not a valid filename. Please try again, avoiding special characters.`\n    )\n    return false\n  }\n  if (process.platform === `win32` && INVALID_WINDOWS.test(value)) {\n    reporter.warn(\n      `The destination \"${value}\" is not a valid Windows filename. Please try another name`\n    )\n    return false\n  }\n  if (fs.existsSync(path.resolve(value))) {","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/create-gatsby/src/utils/question-helpers.ts#L17-L53","documentation":"Validation-helper warning from create-gatsby's project name validator (used as the inquirer `valid` function): the answer was empty/falsy, which typically happens when running `create-gatsby -y` (defaults mode) without passing a directory name argument. Validation fails so the prompt (or process) rejects the value.","triggerScenarios":"Thrown at packages/create-gatsby/src/utils/question-helpers.ts:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the site directory name as an argument, e.g. `npm init gatsby@latest my-site -y`"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}