{"record":{"id":"b1d21105b153e80a","repo":"gatsbyjs/gatsby","slug":"found-unknown-argument-arg-ignoring-known-a","errorCode":null,"errorMessage":"Found unknown argument \"${arg}\", ignoring. Known arguments are: ${Flag.yes}, ${Flag.ts}","messagePattern":"Found unknown argument \"(.+?)\", ignoring\\. Known arguments are: (.+?), (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/create-gatsby/src/utils/parse-args.ts","lineNumber":39,"sourceCode":" * - `npm init gatsby hello-world -y`\n * - `npm init gatsby -y hello-world`\n *\n * We deliberately trade the edge case of a user attempting to create a directory name\n * prepended with a dash (e.g. `-my-project`) for flags that work regardless of position.\n */\nexport function parseArgs(args: Array<string>): IArgs {\n  const { flags, dirName } = args.reduce(\n    (sortedArgs, arg) => {\n      switch (arg) {\n        case Flag.yes:\n          sortedArgs.flags.yes = true\n          break\n        case Flag.ts:\n          sortedArgs.flags.ts = true\n          break\n        default:\n          if (arg.startsWith(`-`)) {\n            reporter.warn(\n              `Found unknown argument \"${arg}\", ignoring. Known arguments are: ${Flag.yes}, ${Flag.ts}`\n            )\n            break\n          }\n          sortedArgs.dirName = arg\n      }\n      return sortedArgs\n    },\n    {\n      flags: {\n        yes: false,\n        ts: false,\n      },\n      dirName: ``,\n    }\n  )\n\n  return {","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/create-gatsby/src/utils/parse-args.ts#L21-L57","documentation":"create-gatsby CLI arg parsing: an argument starting with '-' matched neither the yes flag nor the TypeScript flag, so it is ignored rather than used as the site directory name; only -y and -ts are recognized.","triggerScenarios":"Thrown at packages/create-gatsby/src/utils/parse-args.ts:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the unknown flag from the command","Use only the supported flags: -y/--yes and -ts"],"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"}