码迷,mamicode.com
首页 > Web开发 > 详细

Debug in Node.js

时间:2015-04-11 19:33:03      阅读:315      评论:0      收藏:0      [点我收藏+]

标签:node.js   chrome   

  • 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

标签:node.js   chrome   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!