Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto update isn't working in VSCode: Could not create temporary directory: Permission denied

From certain point I started getting this error from time to time(I suppose it fires when editor tries to check for updates), and manual/auto update doesn't work. The only way I can update the editor is re-download the app and replace it manually.

Does someone face same issue and successfully resolved?

Screenshot

like image 701
flppv Avatar asked Apr 05 '19 23:04

flppv


People also ask

How do I set Vscode to auto update?

By default, VS Code will also auto-update extensions as new versions become available. If you do not want extensions to automatically update, you can clear the Extensions: Auto Update check box in the Settings editor (Ctrl+,).

How do I disable Vscode auto update?

It will auto-update when vscode found any new updates. If you want to completely disable the update then it is to "update. mode":"none". 🕜 Also Read: How to insert a vertical line in VS Code?

Why my VS code is not working?

Common issues on Windows# You can check and disable compatibility mode by right-clicking on the VS Code executable and selecting properties, then uncheck the Run this program in compatibility mode option in the compatibility tab.

How do I fix code in VS code?

Clicking on the Code Action lightbulb or using the Quick Fix command Ctrl+. will display Quick Fixes and refactorings. If you'd just like to see refactorings without Quick Fixes, you can use the Refactor command (Ctrl+Shift+R).


3 Answers

Try to type the following commands in a terminal:

cd ~/Library/Caches

sudo chown -R <username>:staff *
like image 197
pakhilov Avatar answered Oct 08 '22 14:10

pakhilov


The above solution works, but it is like using a sledge hammer to kill a house fly.

  1. Go to Caches cd ~/Library/Caches.
  2. Check ownership of folders. ls -la
  3. You will probably see drwxr--r-- 2 root staff 64 Nov 15 09:37 com.microsoft.VSCode.ShipIt
  4. Run sudo chown <username>:staff com.microsoft.VSCode.ShipIt

This allows you to only update that folder owner and won't touch the other folders. You can break over item unexpectedly.

like image 39
barney74 Avatar answered Oct 08 '22 12:10

barney74


In my case, ~/Library/Caches/com.microsoft.VSCode.ShipIt was owned by root:staff all of a sudden. I fixed it by running the following command:

sudo chown -R $USER:'staff' ~/Library/Caches/com.microsoft.VSCode.ShipIt

(added single quotes around the group name because ZSH didn't like it)

like image 5
szx Avatar answered Oct 08 '22 12:10

szx