首页 > Web开发 > 详细

Debug in Node.js

时间:2015-04-11 19:32:24      阅读:252      评论:0      收藏:0      [点我收藏+]
  • Using console object: console.log(‘xxx‘);
  • Using Node.js internal debugger (v8 engine): node debug xxx.js

How to use node-inspector:
  1. In one terminal, run "node-inspector" to start the node inspector server.
  2. In another terminal, run 
     node --debug your/node/program.js
  1. Or
    node --debug-brk your/short/node/script.js // pause your script on the first line
    to start your node process.
  2. Launch Chrome or Opera, open http://127.0.0.1:8080/debug?port=5858 to launch debugger UI. (Server code can be shown here)
    • You can set breakpoint to code (although you may cannot see the breakpoint first time, click "Refresh" button on browser, you can see program will stop at the breakpoint you set last time.)

Debug in Node.js

原文:http://blog.csdn.net/chuwachen/article/details/44997339

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!