gatsbyjs/gatsby · error
Found unknown argument "${arg}", ignoring. Known arguments a
Error message
Found unknown argument "${arg}", ignoring. Known arguments are: ${Flag.yes}, ${Flag.ts} What it means
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.
Source
Thrown at packages/create-gatsby/src/utils/parse-args.ts:39
* - `npm init gatsby hello-world -y`
* - `npm init gatsby -y hello-world`
*
* We deliberately trade the edge case of a user attempting to create a directory name
* prepended with a dash (e.g. `-my-project`) for flags that work regardless of position.
*/
export function parseArgs(args: Array<string>): IArgs {
const { flags, dirName } = args.reduce(
(sortedArgs, arg) => {
switch (arg) {
case Flag.yes:
sortedArgs.flags.yes = true
break
case Flag.ts:
sortedArgs.flags.ts = true
break
default:
if (arg.startsWith(`-`)) {
reporter.warn(
`Found unknown argument "${arg}", ignoring. Known arguments are: ${Flag.yes}, ${Flag.ts}`
)
break
}
sortedArgs.dirName = arg
}
return sortedArgs
},
{
flags: {
yes: false,
ts: false,
},
dirName: ``,
}
)
return {View on GitHub (pinned to e85d62f177)
Solutions
- Remove the unknown flag from the command
- Use only the supported flags: -y/--yes and -ts
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/create-gatsby/src/utils/parse-args.ts:39 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26).
Data as JSON: /api/errors/b1d21105b153e80a.
Report an issue: GitHub.