{"record":{"id":"b34d8d16f76b8f69","repo":"gatsbyjs/gatsby","slug":"starter-starterpath-doesn-t-exist","errorCode":null,"errorMessage":"starter ${starterPath} doesn't exist","messagePattern":"starter (.+?) doesn't exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-cli/src/init-starter.ts","lineNumber":140,"sourceCode":"  } finally {\n    process.chdir(prevDir)\n  }\n}\n\nconst ignored = (path: string): boolean =>\n  !/^\\.(git|hg)$/.test(sysPath.basename(path))\n\n// Copy starter from file system.\nconst copy = async (\n  starterPath: string,\n  rootPath: string\n): Promise<boolean> => {\n  // Chmod with 755.\n  // 493 = parseInt('755', 8)\n  await fs.ensureDir(rootPath, { mode: 493 })\n\n  if (!existsSync(starterPath)) {\n    throw new Error(`starter ${starterPath} doesn't exist`)\n  }\n\n  if (starterPath === `.`) {\n    throw new Error(\n      `You can't create a starter from the existing directory. If you want to\n      create a new site in the current directory, the trailing dot isn't\n      necessary. If you want to create a new site from a local starter, run\n      something like \"gatsby new new-gatsby-site ../my-gatsby-starter\"`\n    )\n  }\n\n  report.info(`Creating new site from local starter: ${starterPath}`)\n\n  report.log(`Copying local starter to ${rootPath} ...`)\n\n  await fs.copy(starterPath, rootPath, { filter: ignored })\n\n  report.success(`Created starter directory layout`)","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-cli/src/init-starter.ts#L122-L158","documentation":"Thrown by the `copy` helper in gatsby-cli's init-starter after ensureDir succeeds but fs.existsSync(starterPath) returns false. It guards the local-starter branch of `gatsby new <site> <starter>` where the starter argument is treated as a filesystem path rather than a GitHub repo shorthand.","triggerScenarios":"Running `gatsby new my-site ./nonexistent` or `gatsby new my-site ../missing-starter` so the resolved starterPath does not exist on disk; passing a relative path resolved against an unexpected cwd; a typo in the starter directory name.","commonSituations":"User intends a local starter but mistypes the path; running `gatsby new` from a scripts/ directory so a relative ../my-starter resolves wrong; the starter directory was deleted or never cloned; shell tab-completion inserted a wrong segment.","solutions":["Confirm the path exists: `ls -la <starterPath>` from the same cwd where `gatsby new` runs.","Use an absolute path to remove cwd ambiguity, or `cd` to the parent of the starter first.","If you meant a remote starter, use the `org/repo` shorthand (e.g. gatsbyjs/gatsby-starter-blog) instead of a filesystem path.","Re-clone the starter repo locally if it was removed."],"exampleFix":"# before\ngatsby new my-site ./stater-typo\n# after\ngatsby new my-site /abs/path/to/gatsby-starter-blog","handlingStrategy":"validation","validationCode":"const fs = require('fs')\nif (fs.existsSync(starterPath) === false) {\n  console.error(`No local starter at ${starterPath}; aborting`)\n  process.exit(1)\n}","typeGuard":"const isExistingPath = (p: string): boolean => { try { return fs.existsSync(p) } catch { return false } }","tryCatchPattern":null,"preventionTips":["Verify the starter path with `ls` before running `gatsby new`.","Prefer absolute paths for local starters to avoid cwd ambiguity.","Use org/repo shorthand for remote starters."],"tags":["gatsby-cli","init-starter","filesystem","cli"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}