Skip to content

Commit 193575e

Browse files
committed
docs(notes): add 2025-03-21-vscode-extension-en.md
1 parent adf1237 commit 193575e

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed
+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
title: Troubleshooting VSCode Extension Installation with Proxy Issues
3+
lang: en
4+
layout: post
5+
audio: false
6+
translated: false
7+
generated: true
8+
---
9+
10+
To check the extension installation log in Visual Studio Code (VSCode) or use the command line to install an extension with `code --install-extension` and view the log—especially if you suspect a proxy issue—here’s how you can proceed:
11+
12+
---
13+
14+
### Using the Command Line with `code --install-extension`
15+
You can install extensions via the command line and get some visibility into the process, which might help diagnose proxy issues.
16+
17+
1. **Install with Verbose Output**
18+
Run the following command to install an extension and see more detailed output:
19+
```bash
20+
code --install-extension <extension-id> --verbose
21+
```
22+
- Replace `<extension-id>` with the ID of the extension (e.g., `vscodevim.vim`).
23+
- The `--verbose` flag increases the output detail, showing progress and potential errors, such as proxy or network issues.
24+
25+
2. **Handle Proxy Issues**
26+
If you’re behind a proxy, it might interfere with the installation. Try these approaches:
27+
- **Set Proxy Environment Variables**:
28+
Before running the command, configure the proxy settings:
29+
```bash
30+
export HTTP_PROXY=http://your-proxy-server:port
31+
export HTTPS_PROXY=http://your-proxy-server:port
32+
code --install-extension <extension-id>
33+
```
34+
- On Windows, use `set` instead of `export`:
35+
```cmd
36+
set HTTP_PROXY=http://your-proxy-server:port
37+
set HTTPS_PROXY=http://your-proxy-server:port
38+
code --install-extension <extension-id>
39+
```
40+
- **Specify Proxy Directly**:
41+
Use the `--proxy-server` flag:
42+
```bash
43+
code --install-extension <extension-id> --proxy-server=http://your-proxy-server:port
44+
```
45+
46+
3. **Check the Output**
47+
- The console output from the `--verbose` flag will show the installation progress and any errors (e.g., connection timeouts or proxy authentication failures).
48+
- Note: The command-line interface (`code`) has limited proxy support compared to the VSCode GUI, so logs might not be as detailed as expected.
49+
50+
---
51+
52+
### Checking Logs in VSCode
53+
For more detailed logs—especially after an installation attempt—use VSCode’s built-in logging features:
54+
55+
1. **Open the Logs Folder**
56+
- Open VSCode and access the Command Palette:
57+
- Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS).
58+
- Type and select **Developer: Open Logs Folder**.
59+
- This opens a folder containing various log files. Look for:
60+
- **`exthost.log`**: Logs related to extension host processes, including installation attempts.
61+
- **`sharedprocess.log`**: Logs for shared processes that might include extension-related events.
62+
- Open these files in a text editor and search for errors mentioning the extension ID, network issues, or proxy problems.
63+
64+
2. **View the Output Panel**
65+
- In VSCode, go to `View > Output` to open the **Output** panel.
66+
- In the dropdown menu on the right, select **Extensions**.
67+
- This shows real-time logs for extension activities when installing from within VSCode (not directly via CLI). If you retry the installation through the VSCode UI, you might see proxy-related errors here.
68+
69+
---
70+
71+
### Additional Steps for Proxy Troubleshooting
72+
Since you suspect a proxy issue, here are extra tips to ensure proper configuration:
73+
74+
- **Configure Proxy in VSCode**
75+
- Open VSCode settings (`File > Preferences > Settings` or `Ctrl+,`).
76+
- Search for `proxy` and set:
77+
```json
78+
"http.proxy": "http://your-proxy-server:port"
79+
```
80+
- Optionally, adjust `"http.proxyStrictSSL"` (set to `false` if needed) or `"http.proxyAuthorization"` (for authenticated proxies).
81+
- These settings apply to installations within VSCode, not necessarily the CLI.
82+
83+
- **Test Network Access**
84+
- Manually test if the proxy allows access to the VSCode Marketplace:
85+
- Find the extension’s VSIX file URL (e.g., from the Marketplace website).
86+
- Use a tool like `curl`:
87+
```bash
88+
curl -x http://your-proxy-server:port <vsix-url>
89+
```
90+
- If this fails, your proxy might be blocking the connection.
91+
92+
---
93+
94+
### Recommended Approach
95+
- **For CLI Installation**: Use `code --install-extension <extension-id> --verbose` with proxy environment variables or `--proxy-server` to see immediate output. Check for errors in the terminal.
96+
- **For Detailed Logs**: Install the extension via the VSCode UI (Marketplace) and check the **Output > Extensions** panel or the logs folder (`exthost.log`).
97+
- **Proxy Check**: Ensure proxy settings are correct in both your system and VSCode.
98+
99+
This combination lets you monitor progress and diagnose proxy issues effectively. If the CLI output isn’t sufficient, the VSCode logs will provide deeper insight into what’s going wrong.

0 commit comments

Comments
 (0)