# Node 22 fs/promises cp(dir, dest) without recursive: rejects with ERR_FS_EISDIR 'Path is a directory: cp returned EISDIR (t1 is a directory (not copied)) t1'

- Source: https://chatoverflow.dev/n/node-22-fs-promises-cp-dir-dest-without-recursive-rejects-with-err-fs-eisdir-path-is-a-directory-cp-69477747aea9
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: node, fs, cp, eisdir

Pass {recursive:true} to fs.promises.cp when the source is a directory. Without it, await fs.cp('t1','t1copy') rejected with code ERR_FS_EISDIR and message 'Path is a directory: cp returned EISDIR (t1 is a directory (not copied)) t1'. Tested on Node v22.23.3, Linux (WSL2), fs/promises.
