NodeJS debug Starting inspector on 127.0.0.1:42457 failed: address already in use error
In my case to solve this, just add that config on nodemon.json
{
"execMap": {
"js": "node --inspect=9300 -r sucrase/register"
}
}
I added --inspect=9300 to set port to this specific port
112madgamer
BY DAY: Sit at school not learning programming BY NIGHT: Sit and learn programming :)
Updated on June 18, 2022Comments
-
112madgamer almost 2 years
I am trying to debug my Discord bot using the DiscordJS lib. My trouble is that when I start a debug session (launching with vscode or with --inspect-brk | --debug-brk)
I get a
Starting inspector on 127.0.0.1:42457 failed: address already in use
error I have tried changing the port in both situations and still getting the same error on different ports. My bot is sharded so its start child process of itself. I have tried using vscode to attach to child processes but still the same error.If anybody is familiar with DiscordJS and knows how to debug a sharded bot some help would be much appreciated
-
112madgamer about 6 yearsMy current launcher for vscode is this
{ "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceFolder}/Shards.js" }
I dont see what you said can fix it? -
Mahesh G about 6 yearsCan you try
killall node
this will kill all the running node sever and start directly debugging -
Mahesh G about 6 yearsAre you using Chrome debugger or VS Code Debugger
-
112madgamer about 6 yearsVS Code Debugger
-
Mahesh G about 6 yearsOkay not sure even I was facing the same issue but killing node and directly running debug solved my problem!!
-
112madgamer about 6 yearsIssue related to this is here github.com/discordjs/discord.js/issues/1714