How to enable debugging from a different host


hi friends,
I am developing an Adonis app in a VM and I’d like to debug it with chrome inspect in my host OS.

How can I change the default IP address for debugging from to

Thanks for helping


You need to tell node to run the debugger on

node --inspect-brk= app.js 

You also need to make sure that your VM opens the necessary ports so that external traffic can connect.

Then use Chrome (or VS Code) to attach to the debugger process.


Thank you!
it works, I just had to change app.js to server.js, like this:

node --inspect-brk= server.js

and of course make sure port 6000 is open with

sudo ufw allow 6000

This makes it, but an even better option would be to use the command provided by adonis, like

adonis serve --dev --debug

setting the debugger IP to (or whatever) instead of May be there is an option for this, but I have not been able to find it. I am just beginning my journey with Adonis (and loving it so far), where can I find the script referenced by “adonis serve”?



You might be able to use NODE_OPTIONS env for that. I didn’t test it though.


Would be great, but for some reason I cannot get it to work :anguished: Looks like the problem is not with Adonis. Here test.js is a simple js file that prints an “Hello world” to the console.

node --inspect-brk test.js 
Debugger listening on ws://
For help see

Using NODE_OPTIONS instead gives

NODE_OPTIONS="--inspect-brk" && node test.js 
Hello World

I guess I am doing something wrong but can’t figure out what. It looks like node is not honoring the env variable… version is 8.11.1 btw, and OS is ubuntu 16.04.

a bit puzzled.


EDIT: never mind, I was wrong!


Interestingly, I can’t get it to work on a Mac also. Node version v9.8.0.