Node.js: How to attach to a running process and to debug the server with a console?

后端 未结 7 1425
無奈伤痛
無奈伤痛 2020-12-04 21:51

I use \'forever\' to run my application. I want to attach to the running environment to inspect my application. So what can I do?

7条回答
  •  时光取名叫无心
    2020-12-04 22:39

    Even it's an old yet answered question, there is an easier way, which is passing parameters to node:

    forever start -c 'node --debug-brk' main.js
    

    If you don't want to wait for debugger to be attached, replace --debug-brk by --debug

提交回复
热议问题