How do I debug Node.js applications?

后端 未结 30 2096
暗喜
暗喜 2020-11-22 05:56

How do I debug a Node.js server application?

Right now I\'m mostly using alert debugging with print statements like this:

sys.puts(sys.inspe         


        
30条回答
  •  [愿得一人]
    2020-11-22 06:33

    node-inspector could save the day! Use it from any browser supporting WebSocket. Breakpoints, profiler, livecoding, etc... It is really awesome.

    Install it with:

    npm install -g node-inspector
    

    Then run:

    node-debug app.js
    

提交回复
热议问题