1、npm install node-inspector
2、启动 node-inspector
~/$ node-inspector
info - socket.io started
visit 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