Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running node-inspector alongside nodemon?

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!?

like image 978
Jamie Hutber Avatar asked Sep 11 '14 22:09

Jamie Hutber


People also ask

How do I run a node inspect?

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.

How do I debug Nodemon?

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.


1 Answers

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

like image 80
rpaskett Avatar answered Sep 21 '22 14:09

rpaskett