{"record":{"id":"9957d81d531c3c9e","repo":"gatsbyjs/gatsby","slug":"please-mention-both-starter-package-and-project-na","errorCode":null,"errorMessage":"Please mention both starter package and project name along with path(if its not in the root)","messagePattern":"Please mention both starter package and project name along with path\\(if its not in the root\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-cli/src/init-starter.ts","lineNumber":244,"sourceCode":"      {\n        type: `select`,\n        name: `starter`,\n        message: `What starter would you like to use?`,\n        choices: [\n          { title: `gatsby-starter-default`, value: `gatsby-starter-default` },\n          {\n            title: `gatsby-starter-hello-world`,\n            value: `gatsby-starter-hello-world`,\n          },\n          { title: `gatsby-starter-blog`, value: `gatsby-starter-blog` },\n          { title: `(Use a different starter)`, value: `different` },\n        ],\n        initial: 0,\n      },\n    ])\n    // exit gracefully if responses aren't provided\n    if (!response.starter || !response.path.trim()) {\n      throw new Error(\n        `Please mention both starter package and project name along with path(if its not in the root)`\n      )\n    }\n\n    selectedOtherStarter = response.starter === `different`\n    starterPath = `gatsbyjs/${response.starter}`\n    rootPath = response.path\n  }\n\n  // set defaults if no root or starter has been set yet\n  rootPath = rootPath || process.cwd()\n  starterPath = starterPath || `gatsbyjs/gatsby-starter-default`\n\n  return { starterPath, rootPath, selectedOtherStarter }\n}\n\nconst successMessage = (path: string): void => {\n  report.info(`","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-cli/src/init-starter.ts#L226-L262","documentation":"Thrown in the interactive prompts branch of init-starter when the user dismisses prompts without selecting a starter or entering a project path. The guard `if (!response.starter || !response.path.trim())` aborts before any file operations so no half-configured site is created.","triggerScenarios":"Running `gatsby new` with no args in a TTY, pressing Esc/Ctrl-C on the starter or path prompt, or submitting an empty path string. The prompts object (enquirer) returns undefined/empty fields and the validation fires.","commonSituations":"User cancels prompts by accident; non-interactive CI shell where prompts auto-resolve empty; piping empty stdin into `gatsby new`; user expects `gatsby new` to use cwd but leaves the path prompt blank.","solutions":["Re-run `gatsby new` interactively and select a starter, then type a project name (and path if not in cwd).","For non-interactive use, pass args explicitly: `gatsby new my-site gatsbyjs/gatsby-starter-default`.","If scaffolding into the current directory, supply `.` only where supported, or pick an explicit subdirectory name."],"exampleFix":"# before (cancels or leaves path blank)\ngatsby new\n# after (non-interactive explicit args)\ngatsby new my-site gatsbyjs/gatsby-starter-blog","handlingStrategy":"validation","validationCode":"if (!response?.starter || !String(response?.path ?? '').trim()) {\n  console.error('Both starter and project path are required')\n  process.exit(1)\n}","typeGuard":"const hasPromptAnswers = (r: { starter?: string; path?: string }): boolean =>\n  !!r?.starter && !!String(r?.path ?? '').trim()","tryCatchPattern":null,"preventionTips":["Pass explicit args in non-interactive shells.","Do not pipe empty stdin into `gatsby new`.","Provide a TTY for interactive prompts."],"tags":["gatsby-cli","init-starter","interactive-prompts","cli"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}