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
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
Share Improve this question edited Apr 17, 2013 at 5:40 Mohsen 65.8k36 gold badges162 silver badges187 bronze badges asked Oct 10, 2012 at 12:23 Chris G.Chris G. 26k58 gold badges197 silver badges338 bronze badges3 Answers
Reset to default 12Starts 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
Debug using v8 in chrome
in terminal write:
node inspect server.js
navigate to chrome://inspect
go to remote target inspect