最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - node.js debugging with node-inspector and forever.js - Stack Overflow

programmeradmin5浏览0评论

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 badges
Add a comment  | 

3 Answers 3

Reset to default 12

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

Debug using v8 in chrome

in terminal write:

node inspect server.js

navigate to chrome://inspect go to remote target inspect

发布评论

评论列表(0)

  1. 暂无评论