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!
sudo chown -R $(whoami) .
– Tachycardia