Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:9222

I am trying to debugg my angular code with vscode but doesnt work.

enter image description here Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:9222

like image 593
Slinker Avatar asked Apr 22 '16 01:04

Slinker


4 Answers

I'm not sure you still need it, but I found the solution, since I was facing the same issue myself.

You must launch Chrome with remote debugging enabled in order for the extension to attach to it.

Windows

Right click the Chrome shortcut, and select properties In the "target" field, append --remote-debugging-port=9222 Or in a command prompt, execute /chrome.exe --remote-debugging-port=9222

OS X

In a terminal, execute /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

Linux

In a terminal, launch google-chrome --remote-debugging-port=9222

I've found this info on the vs code chrome extension's github: https://github.com/Microsoft/vscode-chrome-debug

Note - If you have already running instances of Chrome. Close them first before opening the updated Chrome window. Ref:- https://github.com/Microsoft/vscode-chrome-debug/issues/111

like image 121
digaomatias Avatar answered Nov 13 '22 22:11

digaomatias


I got this error because I forgot to close the chrometabs from the previous time the application ran. Just close those tabs and you are up and running again.

like image 45
benjaminoerskov Avatar answered Nov 13 '22 21:11

benjaminoerskov


If you running this application in windows, and show you this message, try just restart your machine. This works for me!

like image 3
Yalle Prado Avatar answered Nov 13 '22 20:11

Yalle Prado


Add-on to the details added by digaomatias

Note: Stop already running Chrome instances/tabs before opening the updated Chrome window.

Reference from Github.

like image 1
Datta1 Avatar answered Nov 13 '22 22:11

Datta1