If all the above solutions did not work AND you are using windows PC like in my case, the easiest thing to do is:
-
Press windows key plus R on your keyboard to open the run command box and type this
resmon.exe
-
click OK to open resource monitor
-
In the monitor, navigate to CPU tab
-
Under Associated Handles in the search box, copy the path to the file or folder in question and paste it in there
-
Click on the search icon
-
You should be able to see all the programs using the file or folder
-
right-click each and end-process

Now, continue what you were trying to do on the file or folder. In my case I was having problems using react-create-app via npm.
More information here #117908
I just hope it helps someone.