

Sudo chmod -R 777 your_project_directory_location Using the chmod -R 777 command ( It depends ) VS Code also warns you about this.Īnd even more dangerous thing is, the user gets the full ability to modify any system file from VS Code without verifying the root password and if the user doesn't know what he/she is actually doing, then there is a high chance that they might bring some serious problem, even they can break the system.

If you run this command from the terminal, then it will forcefully start the VS Code with the root privileges, but running a user-level application, with root privileges is potentially dangerous because if some vulnerability found in VS Code, that might affect your system. Sudo code -user-data-dir="~/.vscode-root" Running VS Code with the root privileges ( not recommended ) If you Google this topic, you will find the same solutions as well but, I would not recommend every solution which you find in the first place and you have to know why it's not. And believe me, it's frustrating as hell especially, if you are working on some kind of web project where you have to save the file frequently in order to track your changes or if you habituated in saving the file after the few lines of typing.Īfter spending a few hours and doing a couple of Google search, I have found some solutions which I am going to discuss. But, here is a catch, it's not going to ask about the sudo privileges for the first or one time, every time when you have to save the file, it will ask the sudo password. Honestly, this is not an error, it's just VS Code needs sudo privilege to save the file and you can easily give it by clicking on the Retry as Sudo. Yesterday I was working on one of my web projects and the problem was, whenever I tried to save my file I was getting an Insufficient permissions error. This is one of the common problems you may face if you are using Visual Studio Code in Linux and that is, VS Code asking about the root permission every time for saving a file.
