VS Code Will Not Save Changes - Mac
Asked Answered
P

3

8

I know this question has been asked before, but none of the advised solutions have worked for me. I am on a Mac and trying to save changes to a VS Code file. When I press save, it says

Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.

When I choose to "Retry as Sudo" I enter my password and it says

Failed to save... Error using --file-write: EPERM: operation not permitted

I have tried a couple of different things to open VS Code with admin privileges, including running it from the terminal with the command:

sudo open /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron

and manually adding VS Code to my path using the commands

cat << EOF >> ~/.bash_profile
# Add Visual Studio Code (code)
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF

I have yet to find anything that affects the failed to save error, and if anyone has any suggestions, they would be greatly appreciated!

Phaedrus answered 27/4, 2020 at 19:50 Comment(0)
P
14

Its no longer an issue after running:
$ sudo chown -R username .

Hope this will resolve all kind of permission issues.

Pollywog answered 9/12, 2020 at 15:38 Comment(1)
This works just good, an even easier way is to just run sudo chown -R $(whoami) .Tachycardia
B
9

05-03-2021

This works for me.

Sudo chown –R username folder-path

e.g

sudo chown -R sampath /Users/sampath/Desktop/Test/renoTracker/platforms/ios

Bonnes answered 5/3, 2021 at 17:34 Comment(0)
N
1

I have fixed my issue by adding user here in permission. May be this can solve your issue enter image description here

Noway answered 11/9, 2020 at 10:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.