permission denied when sed in place edit in mingw
For me, folder was read only. unchecking readonly option fix my problem. Thanks to Zenadix commment
It's caused by Windows security settings.
Open the folder's Properties settings from the context menu. In the Security tab, click Edit, press Add... in the pop-up window and add your user to the list, check Full Control in the Allow column. Press OK twice to apply the changes.
On Windows 10 WSL i got similar issue. The issue was caused by VS code being open and apparently using the file. Closing VS code solved my issue.