11

如何解決 WSL 2 底下無法執行 Windows 應用程式的問題 (run-detectors)...

 3 years ago
source link: https://blog.miniasp.com/post/2020/09/19/WSL-2-run-detectors-unable-to-find-an-interpreter-for-vscode
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
choose_the_right_partner3.png

我最近經常在 WSL 2 環境下開發,這樣不但可以大幅減少電腦的各種複雜配置與相依問題,有時候執行速度甚至比 Windows 還快。但我其中一台電腦這幾天卻出現了個詭異問題,想要執行 code . 卻會出現 run-detectors: unable to find an interpreter for /mnt/c/Program Files/Microsoft VS Code/Code.exe 的錯誤訊息,無法成功啟動 VSCode 執行,找了好一會兒才解決。

問題發生原因

老實說,我並不清楚問題怎麼發生的,但我有整理幾個相關的 Issues 供未來研究:

網路上找到幾種解決方案,供各位參考,我自己是透過下列第 1 種解決方案搞定問題的!

  1. 在 WSL 2 的 Shell 中執行以下命令

    sudo update-binfmts --disable cli
    
  2. 在 Command Prompt (命令提示字元) 執行以下命令

    wsl --shutdown
    

    注意:上述命令將會關閉「所有」正在執行中的 WSL Distros!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK