Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Workspace Settings permission denied

I'm running Ubuntu 12.04LTS. Have unpacked Visual Studio Code in a folder owned by my user id. All vscode files are owned by my user id (user and group). Have Node.js, npm, typescript installed via apt-get (and npm).

Visual Studio code runs fine, however File->Preferences->Workspace Settings gives this error:

Unable to create 'vscode/settings.json' (Error: EACCES: permission denied, mkdir '/.vscode').

Any ideas on how to resolve this? Where is it trying to do the mkdir?

Thanks,

Bob Wirka

UPDATE: Sudo'd mkdir "/.vscode" (literally at the root level), and chown'd it recursively to my user and group. Voila! Now I can edit the settings.

So, is there a way to tell Visual Studio Code that it shouldn't be trying to use the root folder?

like image 895
bobwirka Avatar asked Nov 24 '15 14:11

bobwirka


2 Answers

Mentioned in the update by the OP but thought I'll mention it explicitly. You need to change the permissions for the folder. The following command will change the owner of the directory so that you can open it without needing root privileges.

$ sudo chown <user-name> -R <directory-name>
like image 125
Nikhita Raghunath Avatar answered Oct 15 '22 09:10

Nikhita Raghunath


I had same issue on my osx. I was able to solve this issue by change the permission to read and write in project folder.

like image 22
Sajith Lakjaya Avatar answered Oct 15 '22 10:10

Sajith Lakjaya