I'm currently using node along with nodemon. Then I got to thinking it might be sometimes nice to use an inspector with node so have started using node-inspector
However, is it possible to run both at the same time?
Normally to run nodemon I would use:
nodemon server.js //and similarly node-debug server.js
I have also tried:
nodemon --debug http.js
But sadly this didn't work either.
But both together!?
Using the Node. To connect to it, open up Google Chrome and enter about:inspect into the URL bar and press Enter. Afterward, you will be redirected to chrome://inspect/ and be presented with a list of available devices to debug. If successful, your screen should show something similar to the image below.
Start server "npm run dev" (as you can see, in "request" property, we set to attach. So we have to run the server firstly and then attach the debugger). Click on the left side of vscode in the bug-like icon. On top you will see the small green play icon.
If you want to run them as one command this works for me: node-inspector & nodemon --debug app.js
(replacing app.js with the name of your script). If things get all mucked up you will occasionally have to kill node-inspector manually, but running the command this way gives you the option of running rs
to restart nodemon manually if needed. HTH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With