-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting inspector on 127.0.0.1:9229 failed: address already in use with nodemon #73818
Comments
It sounds like the previous process is not shut down entirely when nodemon starts the new one. I don't think vscode would cause any issue here. Can you try debugging it with chrome devtools and see whether you get the same thing? |
I've got the same issue: |
the port really dont matter, always says failed: "address already in use", and same with NPM runtime instead NODE nextJS v8.0.3 Debugger listening on ws://127.0.0.1:9229/828bbb76-a120-464b-9030-2555b1275b91
Starting inspector on 127.0.0.1:9229 failed: address already in use |
I am also having this same issue, below is the environment details.
I have another instance of VS Code that does not encounter the issue here
|
I have this issue on "start:win": "set NODE_OPTIONS=\"--inspect\" && yarn verdaccio" Edit: For anyone else having issues, I recommend checking what's actually on the port. |
Also having the same issue here. Run attach to process and show the error. Look up the occupied port with lsof command: lsof -i :9229
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Code\x20H 20544 yukai 48u IPv4 0xxxxxxxxxxxxxxxxx 0t0 TCP localhost:9229 (LISTEN) And found that extension host process is listening to the port 9229
|
It seems like this happens when there's an extension that was updated and is awaiting a restart. |
I'm having this issue as well. It didn't occur until updating to VSCode version 1.40.1. When I find the process running on port 9229 and kill it, I get the following message in VSCode: "Extension host terminated unexpectedly" Is it possible that extension host is now running on port 9229 as of this version? https://code.visualstudio.com/api/advanced-topics/extension-host |
Same issue on 1.40.1. Occurs when debugger attempts to attach to process |
Restarting vscode worked for me! |
I'm getting this.. pretty frustrating. Sometimes I need to restart a couple of times to get it to clear. |
As soon as I start vs code I opened a terminal and used 'netstat -b' and it shows python.exe was using port 9229. I had PlatformIO IDE enabled, tried disabling that and the port became free. Try going through your extensions and disable one at a time and check with netstat. |
According to netstat -abno , vscode is using this process. It might be quite a bear to figure out which extension might be triggering it. Is there a way to set an abritrary port to use in the debug command line, as well as in launch.json ? -- edit: there is: set "port": 9300 in launch.json, and swap "--inspect" on the node command line to "--inspect=9300" works for me. |
I tried to trace code in developer tool. I found that I might be triggered by this line: vscode/src/vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler.ts Line 46 in 4934a6f
And followed by vscode/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts Line 244 in 0f2cda1
Here is the related change: |
ping @jrieken who authored the commit mentioned above and hopefully can help. We've had people running into this for Azure Functions scenarios as well. See MicrosoftDocs/azure-docs#42379 |
Restart vscode didn't help, but I've found a workaround for me.
a little bit hassle but works for me =) Btw, my environment:
|
@FongX777 : thanks! That worked for me in my MacOS :) |
Same happens to me too. Any guess on when we can expect an official patch/fix for this issue? |
Its works, but just temporary. Soon its back. |
Since it is really difficult to understand what is going here, I suggest that we first agree on the recommended "nodemon" debug configuration: {
"type": "node",
"request": "launch",
"name": "nodemon",
"runtimeExecutable": "nodemon",
"program": "${workspaceFolder}/test.js",
"restart": true,
"console": "integratedTerminal"
} If you do not have {
"type": "node",
"request": "launch",
"name": "nodemon",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/nodemon",
"program": "${workspaceFolder}/test.js",
"restart": true,
"console": "integratedTerminal"
} Please note:
Could you please try this approach and report back your experience. Thanks. |
I downgraded to VS Code 1.39.2 and the issue was gone. What was already reported above VS Code is openning the port 9229. |
However, it's probably worth noting that it has absolutely nothing to do with nodemon :-S |
I created #85328 |
It's not a problem with VSCode I think. I am having this issue with nodemon on commandline.
|
@EricJizbaMSFT I've commented on the non-nodemon related issue #85328 and explained how we are planning to address this. |
This issue is only for the nodemon related problems. |
what i did are, kill extension host on help -> process list menu, then npm run debug, after that restart extension host. it worked, but really annoy me |
with my case, kill the port and restart, works for me. |
I've removed the |
thank you @FongX777 |
I had same issue here. I installed this extension: https://marketplace.visualstudio.com/items?itemName=niradler.kill-process Just kill the ports are opened. It works like a charm! |
Mine turned out to be:
based on
Quitting Creative Cloud didn't stop the process, so I did a kill -9 to kill it. In my case, to change the debug port, I included something similar to the following in my package.json:
In my VSCode launch.json file I included something similar to the following in my launch.json:
|
@Yukaii thank you so much |
on my mac, debugger is not working
visual studio code version:
Error on debugger console
lsof -i:portNumber is not helping me. when i run this command, there is no process is actually running. |
i found the solution for protractor (angular 8) debugging issue on visual studio code.
having one file in protractor conf is solving the problem and debubber is running successfully. |
helps |
lsof -i :9229 kill -9 PIDNUMBER |
Just put environment variable flag for debugging in
Worked for me without any issues You can see example config to reference the structure. |
Thanks, @jaekunchoi! It worked for me 😄 |
I've had a similar issue when using NodeJS latest. I fixed it by using node LTS: sudo n lts |
If I get vscode to launched nodemon then it attaches to nodemon, but not my application as a child of nodemon. I can then use "Debug: Attached to Node Process" to attach to my application to debug. If I then update my application, nodemon sends SIGINT, but the process does not terminate. I can only attach to the process if I don't use the NODE_OPTION environment variable with When launching from vscode with
launch.json, where the second auto attaches and allows debugging, but the first doesn't
Part of package.json with nodemon config, where adding
|
This issue contains too much "stuff" and is no longer actionable. |
I am getting the same issues as this issue: #27794
Version: 1.32.3
Commit: a3db5be
Date: 2019-03-14T23:38:49.842Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 4.10.0-32-generic
Steps to Reproduce:
launch.json
nodemon.json
The behavior I see is that it randomly happens. My best guess is that the previous attached debugger hasn't finished closing down when the new one tries to start up on the same port. This is due to the
"restart": true
. I don't know how this process works but from what I read it keeps track of the node process, but does it keep track of the previous debugger?The text was updated successfully, but these errors were encountered: