VSCode does not allow me to save for macOS in 2 minutes

Sergi Jiménez
2 min readJun 16, 2024

--

VSCode icon.
Author owns image rights. Icons from app developers.

Visual Studio Code is a widely used code editor that can present permissions issues when saving files on Unix-based operating systems such as macOS and Linux. It happens because these systems strictly manage file and directory permissions, often forcing users to grant additional permissions each time they try to save changes. In this article, we will explore the causes and solutions to mitigate this drawback on macOS.

What is VSCode?

Visual Studio Code is a free and open source code editor developed by Microsoft. Released in 2015, it has become popular due to its intuitive interface, extensibility through plugins and support for numerous programming languages.

How do we solve it?

When dealing with system permissions there are several solutions that can be useful depending on the case. Here we will explain three of them.

Running VSCode with elevated permissions (not recommended)

We will open the application from a terminal and execute the following command:

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

In this way we will start the application and we will be able to save in it but we will always have to open the application in the same way.

Adjust working directory permissions (depends on the situation)

We will open a terminal and execute the following command:

sudo chmod -R 775 /path/of/the/project

## Example:
sudo chmod -R 775 /Desktop/example-project

This way the project will have the necessary permits.

Granting global permissions to VSCode (recommended)

In order to grant additional permissions to VSCode in macOS we will have to go to “System Preferences”. Inside, in the search engine, we will write “Full disk access”. We will have to make sure that the “Visual Studio Code” option has the permissions granted. This way we will always be able to save the projects in Visual Studio Code.

Conclusion

Permission issues when saving files in VSCode can be frustrating, but with these practical solutions we can address this issue. By applying these solutions we can improve workflow and minimize interruptions.

--

--

Sergi Jiménez
Sergi Jiménez

Written by Sergi Jiménez

Con una taza de café en una mano y un teclado en la otra, ¡soy el maestro del código y el rey de los bugs! https://github.com/sergiJimenez

No responses yet