You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VS Code安装‘C/C++’扩展报错,下载所有扩展均失败,重装后问题仍存在如何解决?

Fixing VS Code Extension Installation Failures (Affects All Extensions)

Hey there, sorry to hear you're stuck with this frustrating extension installation issue in VS Code—especially since reinstalling the app didn’t fix it. Let’s walk through some targeted fixes that usually resolve this kind of widespread problem:

1. Fully Clean VS Code's Cache & User Data

A standard reinstall often leaves behind corrupted cache files or misconfigured user data that’s still causing issues. Let’s wipe those completely to start fresh:

  • Windows:
    • Close VS Code completely (check task manager to make sure no background processes are running).
    • Delete these two folders:
      • %APPDATA%\Code (stores your settings, installed extensions, and cached data)
      • %USERPROFILE%\.vscode (another common location for extensions and cache)
  • macOS:
    • Quit VS Code fully.
    • Delete these folders via Finder or terminal:
      • ~/Library/Application Support/Code
      • ~/.vscode
  • Linux:
    • Close all VS Code windows.
    • Delete these directories in terminal:
      • ~/.config/Code
      • ~/.vscode
  • After deleting these, reinstall VS Code from scratch.

2. Troubleshoot Network & Proxy Issues

Most widespread extension install failures trace back to network restrictions. Let’s rule these out:

  • Temporarily Disable Proxy/VPN: If you’re using a system proxy or VPN, turn it off and try installing an extension again. Proxies often block VS Code’s connection to the extension marketplace.
  • Adjust VS Code’s Network Settings:
    • Open VS Code, go to File > Preferences > Settings (or press Ctrl+, / Cmd+,).
    • Search for http.proxy—make sure no incorrect proxy URLs are set. If you need a proxy, double-check the address and port are accurate.
    • Try toggling http.proxyStrictSSL to false temporarily (note: this reduces security, so revert it if the fix works).
  • Check Firewall/Antivirus: Your system firewall or antivirus might be blocking VS Code from accessing the internet. Add VS Code to your allowed apps list, or temporarily disable the antivirus to test (remember to re-enable it afterward).

3. Manually Install Extensions

If the marketplace is unreachable, bypass it with manual installation:

  • Open the official VS Code Extension Marketplace website in your browser.
  • Search for the extension you want, download the .vsix file (look for the "Download Extension" option under the "Resources" section on the extension’s page).
  • In VS Code, open the Extensions panel (Ctrl+Shift+X / Cmd+Shift+X), click the three dots (...) in the top-right corner, select Install from VSIX..., and pick the downloaded file.

4. Fix File Permission Issues

VS Code might not have permission to write to its installation or extension folders:

  • Windows: Right-click the VS Code shortcut, select Run as administrator, then try installing an extension.
  • macOS/Linux: Ensure the .vscode folder has the correct permissions. Run this command in terminal:
    chown -R $USER:$USER ~/.vscode
    
    This sets your user account as the owner of the folder, fixing write-access blockages.

5. Reset VS Code to Default Settings

Corrupted user settings could be the culprit:

  • Open VS Code, press Ctrl+Shift+P / Cmd+Shift+P to open the command palette.
  • Search for Preferences: Reset Settings and select it. Confirm the reset when prompted—this won’t delete your extensions, but will revert all settings to default.

6. Test with the Portable Version

If all else fails, the portable version can help rule out system-wide issues:

  • Download the portable version of VS Code from the official website (look for the "Portable" option for your OS).
  • Extract it to a folder, run the executable, and try installing an extension. If it works, the problem is tied to your main installation’s configuration or system-level permissions.

内容的提问来源于stack exchange,提问作者Krity Haque Charu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.28 15:49:05