Is it possible to debug the current production Node application?

I am debugging locally by running node --debug and using the node-inspector . The node inspector should work in the background, then I indicate that my browser (not all browsers work, Chrome does) before http://127.0.0.1:8080/debug?port=5858 for debugging.

The problem is that I cannot start the production server locally (missing private key files that do not belong to the dev device), which makes it very difficult to debug certain production problems, even if I am ready to crack the production machine. Is this possible with Node Inspector?

+4
source share
1 answer

Yes, you just need to follow a few steps from the node inspector README :

  • The node inspector must be running on the machine with the node process that you are trying to debug. Therefore, you should be able to install it there.
  • Presumably your production process did not start with the --debug flag. You can send a signal to achieve this, though: kill -s USR1 <pid> . (pid can be obtained using ps aux | grep node .)
  • Make sure port 8080 is located on your local computer from your production machine.
  • Name your browser as usual; you are all set.
+4
source

Source: https://habr.com/ru/post/1498515/


All Articles