Fix VS Code Update Error: There was an error while Deleting a directory

shahadat-shemul-O2MdroNurVw-unsplash

If you found this page, then most likely you’re updating or restarting Visual Studio Code (referred to as VS Code) and you got this error message…

There was an error while Deleting a directory: [path]  The process cannot access the file because it is being used by another process. (os error 32)  Please verify there are no Visual Studio Code processes still executing

There was an error while Deleting a directory: [path]

The process cannot access the file because it is being used by another process. (os error 32)

Please verify there are no Visual Studio Code processes still executing

You probably tried hitting the “Retry” button so many times, but it doesn’t seem to help.

Well, I struggled with this for a while and finally discovered what the problem was.  Luckily for you, your fix may be as simple as mine was.

Verify No VS Code Processes Still Executing

Before I get into the fix for me, you should obviously follow the instructions in the last line of the error message.

If you have another instance of VS Code still running while you’re trying to update it, that’s going to cause a problem.  Close the other instance and click “Retry” on the error message.

Kodi Conflicts with VS Code’s Update Process

If you use Kodi like I do (I write about on my other blog), and you happen to have it open, then it’s most definitely the culprit.

I’ve witnessed this time and time again.  If I have Kodi open, while I update VS Code, I get this error message every time.

The solution is to simply exit and close the Kodi app and then you can click the “Retry” button on that error message.  It should finish updating just fine.

Side comment… I think that this is just so strange that these two apps have this conflict.  I haven’t had any other app have any other issues while running either of them, but for some reason the Kodi app is holding on to some part of the storage that VS Code uses.  I hope they fix this in the future, but it’s been going on for a while so I’m not holding my breath.

Not Kodi?  Must be Another App

If you run into this issue and you’re not running the Kodi app, then there must be another app that is doing something similar to whatever Kodi is doing that causes this.

My recommendation is to close suspecting apps one at a time, clicking the “Retry” button after each time you close another app.

If you find the culprit, leave a comment down below to let other people know who run into this issue.  That you be a big help.

Subscribe
Notify of
guest
1 Comment
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Jon Von Tobel
Jon Von Tobel
1 month ago

I was having the same issue. I closed Microsoft Teams and VS Code update completed successfully.