VS Code is unable to rename folders in JavaScript projects when this folder contains a file with an 'import' statement that imports a file from a subfolder.
Since this is a very common situation in js projects, this has become a very frequent problem.
When the issue manifests itself, I get the error:
Error: EPERM: operation not permitted, rename 'd:\project\parentFolder' -> 'd:\project\newName'
The Setup:
Inside an empty project,
Getting the Issue
VS Code will hang, the bottom bar will say it's trying to rename the file, and after a while, the file won't be renamed and I get the error stated above.
If VS Code is reloaded and the parentFile.js is kept closed, the issue won't appear. But if it was opened once, even if the file is closed before renaming it, the issue will appear.
I had the same issue and found out that the solution is to stop the development server before renaming the folders.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With