Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code Will Not Save Changes - Mac

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!

like image 381
Jackson Ramirez Avatar asked Mar 03 '23 12:03

Jackson Ramirez


1 Answers

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

like image 55
Sampath Avatar answered Mar 05 '23 17:03

Sampath