vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Mac - Unable to connect to the runtime process

Open baotongw opened this issue 10 years ago • 13 comments

  • VSCode Version: 1.3
  • OS Version: Mac 10.11.5
  • node version: 5.10.1

Steps to Reproduce:

  1. open vscode and create a folder with an index file that console.log sth
  2. switch to the debug tab and set the index file and run.
  3. error popup as title and show reason 'getaddrinfo ENOTFOUND localhost undefined:19448' (random port)

baotongw avatar Jul 13 '16 07:07 baotongw

@sdwangbaotong how does your launch.json look like?

weinand avatar Jul 13 '16 08:07 weinand

my launch.json

{ "version": "0.2.0", "configurations": [ { "name": "启动", "type": "node", "request": "launch", "program": "${workspaceRoot}/test.js", "stopOnEntry": true, "args": [], "cwd": "${workspaceRoot}", "preLaunchTask": null, "runtimeExecutable": null, "runtimeArgs": [ "--nolazy" ], "env": { "NODE_ENV": "development" }, "externalConsole": false, "sourceMaps": false, "outDir": null }, { "name": "附加", "type": "node", "request": "attach", "port": 5858, "address": "localhost", "restart": false, "sourceMaps": false, "outDir": null, "localRoot": "${workspaceRoot}", "remoteRoot": null }, { "name": "Attach to Process", "type": "node", "request": "attach", "processId": "${command.PickProcess}", "port": 5858, "sourceMaps": false, "outDir": null } ] }

baotongw avatar Jul 13 '16 08:07 baotongw

@sdwangbaotong does a nslookup localhost from the command line work?

weinand avatar Jul 13 '16 08:07 weinand

looks yes, check below. sorry I'm new to Mac OS and thanks for help.

Server: 192.168.101.58 Address: 192.168.101.58#53

Non-authoritative answer: Name: localhost Address: 127.0.0.1

baotongw avatar Jul 13 '16 08:07 baotongw

I also met this problem. But it just show "Unable to connect to the runtime process ( reason: connect ETIMEDOUT 218.16.124.68:49168 )" . Thanks for help.

VSCode Version: Code 1.3.1 (e6b4afa53e9c0f54edef1673de9001e9f0f547ae, 2016-07-12T13:31:10.994Z) OS Version: Darwin x64 14.5.0

Server: 192.168.60.129 Address: 192.168.60.129#53 Non-authoritative answer: Name: localhost.local.jobcn.com Address: 218.16.124.68

viccici avatar Jul 13 '16 08:07 viccici

Please try the following: Instead of launching the node program from VS Code, launch it from the command line like this:

node --debug-brk --nolazy test.js

Then in VS Code select and run the '附加' launch config. Does it make a difference?

weinand avatar Jul 13 '16 13:07 weinand

Thanks weinand. Follow your directions and it works successfully.

viccici avatar Jul 14 '16 00:07 viccici

Yes, that work. attach to process find the localhost and port and debugger works as expect in this way.

baotongw avatar Jul 14 '16 03:07 baotongw

I'm glad that 'attach' works for you. But it is strange that 'launch' doesn't. Launch basically does the same as what you are doing from the command line: starting node with the --debug-brk flag (but a random port) and then it attaches to that port. I cannot explain why you are getting the error. Do you have a special firewall that blocks specific port ranges?

weinand avatar Jul 14 '16 07:07 weinand

@weinand I finally found the reason. Because i deleted '127.0.0.1 localhost' from the hosts file. @sdwangbaotong It may be available for you.

viccici avatar Jul 15 '16 03:07 viccici

@viccici yes, a missing localhost entry explains it.

weinand avatar Jul 15 '16 08:07 weinand

I'm sorry for the late reply, @viccici yes I also removed the mapping entry from the hosts for work reason. after add it back vscode run correctly.

and @weinand @viccici thanks for your help ^_^

baotongw avatar Jul 25 '16 07:07 baotongw

@sdwangbaotong great, thanks for letting me know.

weinand avatar Jul 25 '16 09:07 weinand