VS Code is not open in WSL -2 Ubuntu 18.04 server - giving command 'code' not found

Viewed 263

I have give this type of error in wsl when I type code .

samanthika-137:~/repos/wams$ code .

Command 'code' not found, did you mean:

  command 'cde' from deb cde (0.1+git9-g551e54d-1.1build1)
  command 'cdde' from deb cdde (0.3.1-1build1)
  command 'ode' from deb plotutils (2.6-10build1)
  command 'node' from deb nodejs (10.19.0~dfsg-3ubuntu1)
  command 'tcode' from deb emboss (6.6.0+dfsg-7ubuntu2)

Try: sudo apt install <deb name>
1 Answers

This issue caused because of window update and disconnect. I have done these steps

  1. Go to ubuntu home directory and delete . vscode-server enter image description here

  2. Then go to setting -> Apps -> search ubuntu->go to advanced options -> Reset -> Repair

enter image description here

  1. The go to run and type service.msc

enter image description here

  1. Go to LxssManager and right click and restart enter image description here

  2. Now go to the ubuntu terminal and type code . It will download vs code and it works

Related