Phpstorm attach to nodejs/chrome not connecting

Hi all,

I have this setup:

PhpStorm 2021.3.2

One nodejs 16.4.0 service inside a docker container, that exposes node inspect port

- "9300:9300" # node inspector port when running in debug mode



I am using typescript + ts+node + nodemon to provide one `debug` script like this in package.json

"debug": "nodemon --config nodemon.debug.json",

and the content of nodemon.debug.json is

"watch": ["src"],
"exec": "node --inspect-brk= --require ts-node/register --require tsconfig-paths/register src/index.ts",
"ext": "js,ts"


running yarn debug inside the docker container works fine and gives expected message:

[nodemon] starting `node --inspect-brk= --require ts-node/register --require tsconfig-paths/register src/index.ts`
Debugger listening on ws://
For help, see:



The problem is that when I want to connect from phpstorm to this listening node inspect it fails with message

`Cannot connect to localhost:9300`


My config:



Please any help here.

Comment actions Permalink

Works fine for me using similar setup. What is a result of opening http://localhost:9300/json in browser? Also, what is the output of docker container ls command?

Comment actions Permalink

Hi, I am closing this issue because is resolved by itself after restarting mac.


Not sure what was the underlying reason, maybe docker did not bind container port 9300 to localhost or something else, but after restart now works.


Thank you for the reply


Please sign in to leave a comment.