gatsbyjs/gatsby · error

The destination "${value}" is not a valid Windows filename.

Error message

The destination "${value}" is not a valid Windows filename. Please try another name

What it means

Validation-helper warning from create-gatsby's project name validator: on Windows (process.platform === 'win32') the name matched the INVALID_WINDOWS pattern (reserved names like CON/PRN, or characters such as <>:"|?*). The validator returns false so the name is rejected.

Source

Thrown at packages/create-gatsby/src/utils/question-helpers.ts:48

  return [none, divider, ...entries]
}

export function validateProjectName(value: string): boolean {
  if (!value) {
    reporter.warn(
      `You have not provided a directory name for your site. Please do so when running with the 'y' flag.`
    )
    return false
  }
  value = value.trim()
  if (INVALID_FILENAMES.test(value)) {
    reporter.warn(
      `The destination "${value}" is not a valid filename. Please try again, avoiding special characters.`
    )
    return false
  }
  if (process.platform === `win32` && INVALID_WINDOWS.test(value)) {
    reporter.warn(
      `The destination "${value}" is not a valid Windows filename. Please try another name`
    )
    return false
  }
  if (fs.existsSync(path.resolve(value))) {
    reporter.warn(
      `The destination "${value}" already exists. Please choose a different name`
    )
    return false
  }
  return true
}

// Enquirer types are not exported and are out of date
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const generateQuestions = (
  initialFolderName: string,
  flags: IFlags

View on GitHub (pinned to e85d62f177)

Solutions

  1. Pick a name avoiding Windows-reserved names (CON, PRN, AUX, NUL, COM1..) and characters like < > : " / \ | ? *
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/create-gatsby/src/utils/question-helpers.ts:48 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/c3afd9214e7c0a3f. Report an issue: GitHub.