#1211·zx

Paths in Git Bash on Windows don't work

Author: SchweinepriesterCreated May 9, 2025Updated May 7, 2026

Reproduction

windows-test.mjs:

import { $ } from 'zx'
import path from 'node:path'
import { fileURLToPath } from 'url'

const __dirname = path.dirname(fileURLToPath(import.meta.url))

$.verbose = true
await $`zx --version`
await $`mkdir -p ${path.join(__dirname, 'AA-zx-test')}`
await $`mkdir -p BB-zx-test`
await $`ls -l | grep zx-test`

Actual behavior

await $`mkdir -p ${path.join(__dirname, 'AA-zx-test')}`

silently does nothing on Windows in Git Bash.

The generated command

mkdir -p $'C:\\git\\frontend_main\\apps\\acheron\\AA-zx-test'

appears to be correct though, as running it manually works.

Works without issue on macOS & Linux in Bash.

Expected

await $`mkdir -p ${path.join(__dirname, 'AA-zx-test')}`

working, as on other OS.