You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fs.rmSync fails on read-only file with EPERM #52253
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
43.0.0
What operating system(s) are you using?
Windows
Operating System Version
Windows 11
What arch are you using?
x64
Last Known Working Electron version
No response
Does the issue also appear in Chromium / Google Chrome?
No
Expected Behavior
fs.rmSync should delete the file even if it's read-only.
Actual Behavior
fs.rmSync in Electron preload (nodeIntegration: true) fails to delete read-only file with: EPERM, Permission denied (Note: Windows 11). See the Gits Fiddle. Press "Create RO file" and then "Remove RO file".
While fsPromises.rm removes the file OK.
Node.version in Electron 43.0.0 is 24.17.0. When I try it with standalone Node.js 24.17.0 from command line, then the file is deleted OK.
Would you be able to check which v40 alpha/beta/nightly version introduced the issue? You can switch Electron versions easily in Electron Fiddle. You can also bisect in Fiddle: View > Toggle Bisect Helper. (You might need to enable nightly versions in the Electron Fiddle settings.)
Activity
nikwen commentedon Jul 3, 2026
Thanks for reporting!
Could you please test if that works and report back?
Would you be able to bisect which version broke it? That will help us find the problematic commit.
xmedeko commentedon Jul 3, 2026
Last good: v39.8.10
First bad: v40.0.0
Same problem when using ipcRenderer and fs.rmSync in the main process. I've updated the Gist and added one more button "Remove RO file in main sync".
nikwen commentedon Jul 6, 2026
Thanks for testing!
Would you be able to check which v40 alpha/beta/nightly version introduced the issue? You can switch Electron versions easily in Electron Fiddle. You can also bisect in Fiddle:
View > Toggle Bisect Helper. (You might need to enable nightly versions in the Electron Fiddle settings.)xmedeko commentedon Jul 7, 2026
Bisect complete. Check the range 40.0.0-alpha.2...40.0.0-alpha.4. (40.0.0-alpha.3 is not in the Fiddle list).
(BTW. I was aware about Fiddle Bisect, but I fist tried If major version upgrade like x.0.0 could cause such breaking change and it worked.)
fix: remove read-only files with fs.rmSync on Windows (#54180)
fix: remove read-only files with fs.rmSync on Windows (42-x-y) (#54257)
fix: remove read-only files with fs.rmSync on Windows (43-x-y) (#54256)
fix: remove read-only files with fs.rmSync on Windows (44-x-y) (#54255)
fix: remove read-only files with fs.rmSync on Windows (#54190)
Remove downloaded package folders safely on Windows (#344)