-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.regressionIssues related to regressions.Issues related to regressions.
Description
Setup:
$ cd ~/tmp
$ touch a
$ mkdir b
$ ln -s b c
Then in Node.js:
> fs.cpSync('a', 'c', { dereference: false })
Uncaught Error: Cannot overwrite directory c with non-directory a
at cpSyncFn (node:internal/fs/cp/cp-sync:56:13)
at Object.cpSync (node:fs:3128:3) {
code: 'ERR_FS_CP_NON_DIR_TO_DIR'
}
> fs.cp('a', 'c', { dereference: false }, console.log)
undefined
> null undefined
The fs.cpSync
call should not be throwing in this case and does not do so in Node.js v20.x. It throws in v22.x, v24.x, and main.
/cc @anonrig @nodejs/fs
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.regressionIssues related to regressions.Issues related to regressions.