使用 node-inspector调试nodejs应用程序

来源:互联网 发布:游唐网络副总裁巴美学 编辑:程序博客网 时间:2024/06/05 17:20

1、npm install node-inspector

2、启动 node-inspector

~/$ node-inspector    info  - socket.io startedvisit http://0.0.0.0:8080/debug?port=5858 to start debugging

3、启动debug

~/node-project$ node --debug-brk app.js //表示从第一行代码开始调试debugger listening on port 5858Error 0

4、打开Chrome浏览器

http://0.0.0.0:8080/debug?port=5858