EACCES: permission denied in VS Code MAC

前端 未结 11 658
我寻月下人不归
我寻月下人不归 2021-01-31 02:20

When I change any file, the system will deny me access. What\'s going on? How do I properly set permissions on Mac?

相关标签:
11条回答
  • 2021-01-31 02:31

    Go to your terminal and input the command:

    sudo "/Applications/Visual Studio Code.app/Contents/MacOS/Electron" ~/.bash_profile
    

    It works for me.

    However, according to the answers on the websites, it is not recommended to get super user permission when you launch the vs code. I am new to vs code as well so I don't know the right method to get permission.

    Besides, on my mac, you will get only permission once when you type in the command and after you exit your vs code, you will not possess the permission if you open the vs code again. I am still working on it and try to fix.

    But this answer should fix your problem.

    0 讨论(0)
  • 2021-01-31 02:44

    Go to your project, double click on the app.js file and select 'Get info'. There will be an option of 'Sharing & Permission'. From there you can change access permissions for other users.

    0 讨论(0)
  • 2021-01-31 02:45

    I had a similar issue. I had error when I tried to create a new component. I just navigated to the path displayed in Finder. For me it was ProjectFolder/src/. So I did right click on "src" folder and selected "Get Info". In that change access to "Read&Write" for my user account. Thats it !!!

    As you are trying to update a file, try to change access permission for that file (ie. app.component.css). If it didn't work try to change access for "app" folder.

    Note: Changing the access of parent/super-parent folder won't work. So change the exact folder's access preferences.

    0 讨论(0)
  • 2021-01-31 02:47

    I managed to fix this on Mac while running this in Terminal

    sudo chown -R $(whoami) /Users/$(whoami)/.vscode

    hope this helps someone

    0 讨论(0)
  • 2021-01-31 02:49

    It is generally not a good idea to run VS Code as sudo. Instead change the permission for the directory.

    You can change the ownership of the directory so that you can open it without needing root privileges.

    $ sudo chown -R <user-name> <directory-name>
    
    0 讨论(0)
提交回复
热议问题