8

So far, I have used "processId": {command: PickProcess} ", maybe it's not the best method, but it always worked." Unfortunately, this method has not worked for a few days. (Please see attachment)

In the console I get "Starting inspector on 127.0.0.1:9229 failed: address already in use".

I have not figured out what the problem is. Can someone give me a hint?

enter image description here enter image description here enter image description here enter image description here

Benjamin Reeves
  • 553
  • 3
  • 6
  • 19

3 Answers3

17

I was facing the same issue on my linux machine.

Ran lsof -i :9229 command to find which process is using port 9229

Then ran kill -9 <process id using the port> Its usually extension manager, then restart

Alternatively, you can open process manager in vs code and kill extension host enter image description here

Then restart vscode and try to debug by using attach to process id

NS23
  • 684
  • 5
  • 14
2

For windows:

C:\Users\Niroshan>netstat -ano|findstr "PID :8080"

Proto Local Address Foreign Address State PID
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 18264

taskkill /pid 18264 /f

as mentioned in this answer:

RayLoveless
  • 19,880
  • 21
  • 76
  • 94
-1

It's easy now. You can open the PORTS tab in the same way as you open the terminal in Visual Studio Code, and you can kill the process. This works even in WSL2:

use the PORTS tab in vscode bottom tools

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77