Vscode Installation Error Permission Denied [Solved]

Problem Common Cause Primary Solution
Permission Denied (EACCES) Installer lacks administrator rights Run as Administrator / Use Sudo
Access is Denied (Windows) Target folder restricted Change installation path or fix folder permissions
Installation Failed (macOS/Linux) Incorrect ownership of /usr/local/bin Chown command or manual move to Applications

Troubleshooting VS Code installation error permission denied on a desktop computer.

What is VS Code Installation Error Permission Denied?

The “VS Code installation error permission denied” occurs when the setup wizard or terminal tries to write files to a directory it doesn’t have authority to modify. This is a security feature of your operating system.

On Windows, this usually happens if you try to install VS Code into the “Program Files” directory without elevated privileges. The installer cannot create folders or move binaries because the system protects these locations.

On macOS and Linux, this error typically stems from restricted write access to the `/Applications` folder or the `/usr/local/bin` directory. This prevents the “code” command from being added to your PATH environment variable.

Step-by-Step Solutions

Solution 1: Run Installer as Administrator (Windows)

If you are using the System Installer on Windows, you must provide administrative consent. This is the most common fix for permission errors.

Locate the VS Code Setup `.exe` file in your downloads folder. Right-click the file and select **”Run as administrator”**. Follow the prompts and ensure you grant permission when the UAC dialog appears.

Solution 2: Fix Folder Ownership (Linux/macOS)

If you encounter permission issues while moving VS Code to your Applications or updating the binary via terminal, you may need to adjust folder ownership.

Use the following command to ensure your user account owns the target directory:

sudo chown -R $(whoami) /usr/local/bin
sudo chmod -R 755 /usr/local/bin

Solution 3: Use the User Installer (Windows)

Visual Studio Code offers two types of installers: System and User. The User Installer is designed to avoid permission issues by installing the app in your local profile.

Download the **User Installer** from the official website. This version installs to `AppData\Local\Programs`, which does not require administrative rights, bypassing the permission denied error entirely.

Solution 4: Disable Antivirus Temporarily

Sometimes, aggressive antivirus software locks the installation directory to prevent unauthorized changes. This can trigger a false “permission denied” flag.

Temporarily disable your real-time protection or add an exclusion for the VS Code installer. Once the installation is complete, you can re-enable your security software immediately.