Search code examples
macosgithubvisual-studio-codepermissionsapple-m1

Failed to save: Insufficient permissions. Select 'Retry as Sudo' to retry as superuser. M1 Mac


I just cloned a GitHub repository on my M1 mac and opened the folder with VsCode but when I make changes in the file and try to save it, I get the error Failed to save 'Home.js': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.

What might be the solution?


Solution

  • You need to change your permissions for this file.

    You can see the permissions for this file running the command:

    ls -@l file
    

    To change the permissions you can run

    sudo chown -v username directory
    

    If you want to change permissions on a whole directory run:

    sudo chown -Rv username directory