簡體   English   中英

WSL 中奇怪的 vscode 問題

[英]Strange vscode issue in WSL

我一直在嘗試設置 vscode code. 在 WSL 中工作的捷徑。 按照vscode 網站的說明,我在 windows 重新安裝了 vscode,重新安裝了 Remote-Wsl 擴展,確保它在我的系統路徑中,並嘗試運行code. 在 WSL linux 發行終端。 我收到指示我在 windows 端安裝它的消息,並詢問我是否要繼續。 我點擊是,但它不會在我的主目錄中創建代碼服務器文件夾。 鍵入code. 再次做同樣的事情。

有誰知道為什么會這樣?

這是 output 文本:

To use Visual Studio Code with the Windows Subsystem for Linux, please install Visual Studio Code in Windows and uninstall the Linux version in WSL. You can then use the code command in a WSL terminal just as you would in a normal command prompt.

Do you want to continue anyway? [y/N]

該錯誤消息不僅指出您需要安裝 Windows 版本,還表明您在 WSL 中安裝了 Linux 版本,應該將其刪除。

由此看來,您可能在某個時候已經在 WSL 中安裝了 Linux 版本的 VSCode ,並且該版本優先。 您需要卸載它才能運行帶有“Remote - WSL”擴展的 Windows 版本的 VSCode。

您沒有提及您正在運行的發行版,但如果它是 Ubuntu,請嘗試:

sudo apt remove code # or
sudo apt remove code-insiders

另請參閱 Microsoft 的卸載文檔。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM