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

后端 未结 7 1427
無奈伤痛
無奈伤痛 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:41

    To inspect nodejs and debug it, use this command

    forever -w -c 'node --inspect=IP:PORT' file.js

    • -c if for a custom command
    • use -w to reload if the file is re-save
    • You can pass ip and port for external inspect
    • port custom is 9229
    0 讨论(0)
提交回复
热议问题