Mac - Unable to connect to the runtime process
- VSCode Version: 1.3
- OS Version: Mac 10.11.5
- node version: 5.10.1
Steps to Reproduce:
- open vscode and create a folder with an index file that console.log sth
- switch to the debug tab and set the index file and run.
- error popup as title and show reason 'getaddrinfo ENOTFOUND localhost undefined:19448' (random port)
@sdwangbaotong how does your launch.json look like?
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 } ] }
@sdwangbaotong does a nslookup localhost from the command line work?
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
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
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?
Thanks weinand. Follow your directions and it works successfully.
Yes, that work. attach to process find the localhost and port and debugger works as expect in this way.
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 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 yes, a missing localhost entry explains it.
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 ^_^
@sdwangbaotong great, thanks for letting me know.