Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WSL vscode command returning error "not found"

I have this message whenever I try to type code .

Screen capture containing an output obtained probably at a Unix-based WSL 2 terminal running on Windows. The output text is quoted exactly in the rest of the question for accessibility.

/mnt/c/Users/jerom/.vscode/extensions/ms-vscode-remote.remote-wsl-0.63.13/scripts/wslCode.sh: 69: /home/jerome/.vscode-server-server/bin/f80445acd5a3dadef24aa209168452a3d97cc326/bin/code: not found

Can someone help me please?

Thanks in advance

like image 319
Jérome BORGA Avatar asked Sep 09 '25 12:09

Jérome BORGA


1 Answers

I just now had the same issue on WSL2 Kali. I tried everything given here: https://github.com/microsoft/vscode-remote-release/issues/2962.

My problem was VS Code was not on Kali's path. Here's how I fixed it :)

echo $PATH
# Confirm PATH is missing this: 
/mnt/c/Users/wcd/AppData/Local/Programs/Microsoft VS Code/bin/

# Confirm VS Code's location then export:
export PATH=$PATH:"/mnt/c/Users/wcd/AppData/Local/Programs/Microsoft VS Code/bin/" 
# It's temporarily added to path...
echo $PATH
# This should now trigger VS Code Server install,
# then open ~/ in VS Code. 
code .

# If above works, make it permanent:
echo 'export PATH=$PATH:"/mnt/c/Users/wcd/AppData/Local/Programs/Microsoft VS Code/bin/"' >> ~/.bashrc

# Restart shell + test
exec "$SHELL"
code .
like image 189
wcDogg Avatar answered Sep 11 '25 00:09

wcDogg