I am unable to debug node.js server when using forever.js. Is it not possible?
Exampel: forever start --debug server.js
1) Starts the server.js ok, but I am unable to debug with node-inspector.
2) forever.js as: forever start server.js
Does not re-start the server - this is the core service of forever?
I am working on a mac.
Thanks Regards
38) Which of the following is a GUI-based debugging tool for Node. js? Answer: D is the correct option. Node Inspector is a GUI-based debugging tool for Node.
A minimal CLI debugger is available with node inspect myscript. js . Several commercial and open source tools can also connect to the Node.
Starts the server.js ok, but I am unable to debug with node-inspector.
Forever does not support debug mode out of the box. You can get around it by asking forever to start a custom command:
$ forever -c 'node --debug' server.js
Does not re-start the server - this is the core service of forever?
I assume you would like to restart the server after a change in source files. I am not very familiar with forever, but I would say you forgot to add -w
option to the command line?
-w, --watch Watch for file changes
To debug a process and have it automatically restarted, run
$ forever -w -c 'node --debug' server.js
See also this node-inspector issue: #196.
Complete instructions on Windows with Chrome
In first terminal run
forever -w -c "node --debug" server.js
In second terminal run
node-inspector
Navigate to localhost:8080
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