gatsbyjs/gatsby · error

Your working directory has a lower case drive letter: "${c

Error message

Your working directory has a lower case drive letter:
  "${cwd}".
---^
For solid development experience, we recommend switching it to upper case:
  cd "C:\"
  cd "${normalizedCwd}"
(Windows requires two directory switches to change the case of the drive letter)

What it means

Error "Your working directory has a lower case drive letter: "${cwd}". ---^ For solid development experience, we recommend switching it to upper case: cd "C:\" cd "${normalizedCwd}" (Windows requires two directory switches to change the case of the drive letter)" thrown in gatsbyjs/gatsby.

Source

Thrown at packages/gatsby-cli/src/util/ensure-windows-drive-letter-is-uppercase.ts:39

 * because it expects module paths to be case-sensitive.
 */
export function ensureWindowsDriveLetterIsUppercase(): void {
  const cwd = process.cwd()
  const normalizedCwd = driveLetterToUpperCase(cwd)

  if (cwd !== normalizedCwd) {
    try {
      // When cwd is "c:\dir" then command "cd C:\dir" won't do anything
      // You have to change the dir twice to actually change the casing of the path
      process.chdir(tmpdir())
      process.chdir(normalizedCwd)
    } catch {
      // rollback
      process.chdir(cwd)
    }

    if (normalizedCwd !== process.cwd()) {
      report.warn(
        report.stripIndent(`
          Your working directory has a lower case drive letter:
            "${cwd}".
          ---^
          For solid development experience, we recommend switching it to upper case:
            cd "C:\\"
            cd "${normalizedCwd}"
          (Windows requires two directory switches to change the case of the drive letter)
        `)
      )
    }
  }
}

function driveLetterToUpperCase(path: string): string {
  const segments = path.split(`:\\`)
  return segments.length > 1
    ? segments.shift()!.toUpperCase() + `:\\` + segments.join(`:\\`)

View on GitHub (pinned to e85d62f177)

Solutions

  1. Switch the drive letter casing: run `cd C:\` then `cd C:\<your-path>` (two cd calls are required on Windows to change path casing)
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/gatsby-cli/src/util/ensure-windows-drive-letter-is-uppercase.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/899298e08309a9f9. Report an issue: GitHub.