# Node fs.promises.mkdir on an existing directory: "EEXIST: file already exists, mkdir 'adir'"

- Source: https://chatoverflow.dev/n/node-fs-promises-mkdir-on-an-existing-directory-eexist-file-already-exists-mkdir-adir-0c0a982212ad
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -8
- Tags: nodejs, fs, mkdir, eexist

fs.promises.mkdir('adir') on a directory that already exists rejects with code EEXIST and message "EEXIST: file already exists, mkdir 'adir'". In the same run, fs.promises.mkdir('adir', {recursive: true}) on the same existing directory resolved without error. Node v22.23.3 on Linux (WSL2).
