Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open VSCode from WSL terminal #209589

Closed
msywulak opened this issue Apr 5, 2024 · 5 comments
Closed

Cannot open VSCode from WSL terminal #209589

msywulak opened this issue Apr 5, 2024 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@msywulak
Copy link

msywulak commented Apr 5, 2024

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.88.0
  • OS Version: 23H2 (OS Build 22631.3374

VSCode
Version: 1.88.0 (user setup)
Commit: 5c3e652
Date: 2024-04-03T13:26:18.741Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.22631

Wsl
wsl --version
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3374

Steps to Reproduce:

  1. Open a WSL terminal
  2. Excecute code .

Expected behavior:
VSCode opens with the current directory

Actual behavior:
VSCode doesn't open and shows the following output:

[2024-04-05 00:35:55.451] node:internal/modules/cjs/loader:1080
[2024-04-05 00:35:55.451]   throw err;
[2024-04-05 00:35:55.451]   ^
[2024-04-05 00:35:55.451] 
[2024-04-05 00:35:55.451] Error: Cannot find module '/home/matt/.vscode-server/bin/5c3e652f63e798a5ac2f31ffd0d863669328dc4c/out/server-main.js'
[2024-04-05 00:35:55.451]     at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
[2024-04-05 00:35:55.451]     at Module._load (node:internal/modules/cjs/loader:922:27)
[2024-04-05 00:35:55.451]     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
[2024-04-05 00:35:55.451]     at node:internal/main/run_main_module:23:47 {
[2024-04-05 00:35:55.451]   code: 'MODULE_NOT_FOUND',
[2024-04-05 00:35:55.451]   requireStack: []
[2024-04-05 00:35:55.451] }

I tried what #179252 found in microsoft/WSL#8843 as their fix but it didn't help me. Was weirdly working all throughout the day then I came back from errands without restarting my computer and stopped working.

matt@Matt-Desktop:~$ cat /usr/lib/binfmt.d/WSLInterop.conf
:WSLInterop:M::MZ::/init:PF
@aeschli
Copy link
Contributor

aeschli commented Apr 5, 2024

Does that path exist? (.vscode-server/bin/5c3e652f63e798a5ac2f31ffd0d863669328dc4c/out/server-main.js)
If not, maybe the installation got corrupted.

  • Close VS Code WSL windows
  • in a WSL terminal run rm -r ~/.vscode-server/bin
  • restart VS Code

@aeschli aeschli added the info-needed Issue requires more information from poster label Apr 5, 2024
@msywulak
Copy link
Author

msywulak commented Apr 5, 2024

It did not... weird that it just corrupted during the day. Redownloading fixed it. Thank you.

@PierTrailslight
Copy link

Hi, I had the same issue, it seems that the installation got corrupted during while i was working. I solved too with rm -r ~/.vscode-server/bin.
Thanks to @msywulak for opening the issue and to @aeschli for the solution.

@aeschli
Copy link
Contributor

aeschli commented May 3, 2024

Thanks for the replies, glad this helped.
Closing the issue.

@aeschli aeschli closed this as completed May 3, 2024
@fadeevab
Copy link
Contributor

fadeevab commented May 3, 2024

@aeschli It happened to me today, and it's the second time in a month. It looks like a consequence of the automatic upgrade (?). Workaround rm -r ~/.vscode-server/bin helps though.
Still, I believe, the issue remains and it may happen again.

@microsoft microsoft locked and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

5 participants