无法连接到目标:连接ECONNREFUSED 127.0.0.1:9222 [英] Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:9222
问题描述
我正在尝试使用vscode调试我的角度代码,但是不起作用.
I am trying to debugg my angular code with vscode but doesnt work.
无法连接到目标:连接ECONNREFUSED 127.0.0.1:9222
Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:9222
推荐答案
我不确定您仍然需要它,但是我找到了解决方案,因为我自己也遇到了同样的问题.
I'm not sure you still need it, but I found the solution, since I was facing the same issue myself.
您必须在启用了远程调试的情况下启动Chrome,才能将扩展程序附加到它.
You must launch Chrome with remote debugging enabled in order for the extension to attach to it.
Windows
右键单击Chrome快捷方式,然后选择属性在目标"字段中,附加--remote-debugging-port = 9222或者在命令提示符下,执行/chrome.exe --remote-debugging-port = 9222
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
在终端中,执行/Applications/Google \ Chrome.app/Contents/MacOS/Google \ Chrome --remote-debugging-port = 9222
In a terminal, execute /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
Linux
在终端中,启动google-chrome --remote-debugging-port = 9222
In a terminal, launch google-chrome --remote-debugging-port=9222
我在vs代码chrome扩展的github上找到了以下信息: https://github.com/Microsoft/vscode-chrome-debug
I've found this info on the vs code chrome extension's github: https://github.com/Microsoft/vscode-chrome-debug
注意-如果您已经在运行Chrome实例.打开更新的Chrome窗口之前,请先关闭它们.参考:- https://github.com/Microsoft/vscode-chrome-debug/Issues/111
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
这篇关于无法连接到目标:连接ECONNREFUSED 127.0.0.1:9222的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!