fs.move fails with EEXIST even when overwrite option is enabled
See original GitHub issueIt doesn’t happen all the time but sometimes I’m getting the following error message when using move()
with the overwrite
options:
{ Error: EEXIST: file already exists, link '/tests/fuzzing/sync/.sync/214b820bf10c4744994fb9a876e433d3.md_1498950555952' -> '/tests/fuzzing/sync/214b820bf10c4744994fb9a876e433d3.md'
at Error (native)
errno: -17,
code: 'EEXIST',
syscall: 'link',
path: '/tests/fuzzing/sync/.sync/214b820bf10c4744994fb9a876e433d3.md_1498950555952',
dest: '/tests/fuzzing/sync/214b820bf10c4744994fb9a876e433d3.md' }
I’m calling it like this, as a promise: fs.move(oldPath, newPath, { overwrite: true });
and most of the time it works but sometime it’s going to generate the EEXIST error. Any idea what could be the reason?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
File.Move Does Not Work - File Already Exists - Stack Overflow
Show activity on this post. According to the docs for File. Move there is no "overwrite if exists" parameter. You tried to specify...
Read more >File.Move Method (System.IO) | Microsoft Learn
Moves a specified file to a new location, providing the options to specify a new file name and to overwrite the destination file...
Read more >How To Work with Files using the fs Module in Node.js
Change your working directory to the newly created folder with the cd command: cd node-files. In this folder, you'll create two files. The...
Read more >Node.js fs-extra move() Function - GeeksforGeeks
The move() function moves a file or a directory from source to the ... set the option of overwrite to true else it...
Read more >mv: Move file only if destination does not exist
On a FreeBSD system: -n Do not overwrite an existing file. (The -n option overrides any previous -f or -i options.).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, I have the same problem with my Windows 10 VM (which is not WSL if I understand well, if not, please tell me)
I think that this issue can occur while perform multiple move operation like this:
Each of move operation include mkdirp itself and can fail on creation common root folder in concurrency mode.