Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code - Error: EPERM: operation not permitted

I have been experiencing A LOT of permission issues when using VS code with Windows 10.

  1. When trying to move a folder:
    • Error: EPERM: operation not permitted, rename 'path a' -> 'path b'
  2. When deleting a folder:
    • It fails silently, the folder is removed from the solution explorer but it persists on disk.

It doesn't work with or without admin rights.

I went to the folder containing all my repos, set the ownership to me, applied full control to all authenticated users, and it still doesn't work.

enter image description here

Any idea ?

EDIT: It does work sometimes, that's what make it very strange

like image 473
Robouste Avatar asked Nov 05 '19 08:11

Robouste


3 Answers

I encountered the error message when renaming or moving files in VS Code. I then noticed that it was the same in Windows Explorer.

I develop in Angular using Angular-CLI and I execute the command ng build --watch in a cmd.

When I stopped the watch command, that solved the issue and I was able to rename and move files in VS Code without any problem.

So I think there are some processes that hold your files. I hope this can help.

like image 87
sirius0607 Avatar answered Oct 22 '22 21:10

sirius0607


I had this issue as well. The cause in my case appeared to be the "Angular Language Service" extension.

I killed that in the extensions pane and was able to rename the file immediately.

Unfortunately, the problem still persists when Angular Language Server is enabled.

like image 23
MShubat Avatar answered Oct 22 '22 21:10

MShubat


I faced the same issue while doing a react project. At first, I thought I need to give admin rights but that also didn't work. Later I found that My project was hosted on my localHost. So, If your project is running we can't change the folder structure. You need to quit the server before updating the folder structure.

Solution: Quit the Localhost Server and try again(For React and Angular Users). You can also try restarting the VScode.

like image 9
Karan Singh Avatar answered Oct 22 '22 21:10

Karan Singh