I have a folder structure like this : C:\Some\Dir\app\app
I want to move C:\Some\Dir\app\app to C:\Some\Dir\app
My code :
fs.move(src, dest, {overwrite: true})
Result with error : Error: ENOENT: no such file or directory, rename 'C:\Some\Dir\app\app' -> C:\Some\Dir\app
Without the overwrite :
Error: dest already exists. at ....\lib\move\move.js:51:31
The only way to do this is to move the directory to some temporary location, then move it back to the parent path. You can't move a directory into its parent directly.
fs-extra
version: 11.1.1I have a folder structure like this :
C:\Some\Dir\app\app
I want to moveC:\Some\Dir\app\app
toC:\Some\Dir\app
My code :
fs.move(src, dest, {overwrite: true})
Result with error :Error: ENOENT: no such file or directory, rename 'C:\Some\Dir\app\app' -> C:\Some\Dir\app
Without the overwrite :
Error: dest already exists. at ....\lib\move\move.js:51:31
I quickly looked at the code of fs-extra, it must come from the fact that you delete the destination folder before so the folder inside no longer exists here : https://github.com/jprichardson/node-fs-extra/blob/cc7b3b22a984de5124131c7897574091c9df00e1/lib/move/move.js#L44