Bun mkdir recursive EEXIST / ENOENT

On Windows, Bun's fs.mkdir(path, { recursive: true }) throws EEXIST or ENOENT for an existing directory when a relative path points above the current directory or names the current directory itself, compared with Node.js and Deno

📅 Created: 2026-10-12 / Updated: 2026-10-16

With recursive: true, fs.mkdir must return without an error when the directory already exists. On Windows, Bun throws EEXIST when a relative path points above the current directory (../x, ./../x, a/../../x), and ENOENT when it names the current directory itself (./, a/..). This project records the measurements against Node.js and Deno, and the comment posted on the existing Bun issue #17332.

To run the tests on Windows (node, deno and bun must be on PATH): tools\40_test\run-tests.cmd

Research

Posts to Bun

Related issues

Rules