How do I resolve the vs code Insufficient permission issue when saving a file
I've given appropriate permissions to code directory: chown -R me:staff my-app/
But when I open vscode and try to save a file it says "Insufficient permissions, Retry as admin"
If I launch vscode with sudo from cmd line sudo code . then I dont get that error but then the autocompletion extensions dont seem to work
Change the permission level of your project directory, for example:
sudo chmod -R 777 testproject
Try this code:
sudo chown -R username directory_name
where,
username
is the username of the user of the laptop you want to give access fordirectory_name
is the name of the directory whose permissions you want to changeTry with the below command(For linux/mac)
sudo chown -R abhinav-kumar my-app
Let’s break this down.
Should I give you a fish? Nope.. that's is not right at all! I should teach you how to fish and it'll save you for a lifetime.
Dear anyone, the issue is all about access permission to that directory or even file sometimes. So you need to use chmod
command to change access permission and we normally use access codes which work as a combination of three octal digits (0-7).
The three
chmod
codes set permissions for these three groups in this order:1. Owner (you) 2. Group (a group of other users that you set up) 3. World (anyone else browsing around on the file system)
Each digit of this code sets permissions for one of these groups as follows. Read is 4. Write is 2. Execute is 1.
The sums of these numbers give combinations of these permissions:
0 = no permissions whatsoever; this person cannot read, write, or execute the file 1 = execute only 2 = write only 3 = write and execute (1+2) 4 = read only 5 = read and execute (4+1) 6 = read and write (4+2) 7 = read and write and execute (4+2+1)
Read more from this article
Hence, in your case you could try running sudo chmod 777 folder-name
which I'm sure it's gonna work! But... It's not safe for use!!! keep it away from the reach of yourself! IT'S A RISK!..
I would suggest to try 755 to make it work. Or something different since you now understand what you're doing! (I mean to fish!)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With