Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36.6k
EPERM when renaming files on Windows #29481
Copy link
Copy link
Closed
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.wontfixIssues that will not be fixed.Issues that will not be fixed.
Description
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.wontfixIssues that will not be fixed.Issues that will not be fixed.
The docs for
fs.rename(oldPath, newPath, callback)say:This happens on Linux/Mac OS X but doesn't appear to happen with Windows. If you run the following script:
You will see:
The same script runs to completion on Linux & Mac OS X without an error.
Setting
countto a low value (e.g.2) doesn't trigger the bug for me, so if it works for you on Windows, your computer is likely faster than mine - try setting it to something unreasonable like1000.This could be what was happening in #6335 and appears at least tangentially related to #21957