我想调试我的sails.js应用程序,但我不知道如何启动节点检查器在这个场合.
通常会去:
$node --debug myapp.js
如果我正常运行我的风帆应用程序:
$sails lift --prod
然后启动节点检查器
$node-inspector --debug-port 1337 Node Inspector v0.7.0-2 info - socket.io started Visit http://127.0.0.1:8080/debug?port=1337 to start debugging.
我在检查器GUI中得到这个错误:
Error: read ECONNRESET. Check there is no other debugger client attached to port 1337.
解决方法
纠正我的错误,但如果帆在1337端口上升,您不能使用调试端口1337.
尝试指定一个不同的端口.
node --debug app.js #this will lift sails on port 1337 and the default debug port i think its 5858 #start node-inspector,once it starts hit enter to put it into background node-inspector &; #visit http://127.0.0.1:8080/debug?port=5858
编辑刚刚确认这个方法的工作,而不是使用sails提升你正在使用节点启动app.js在调试模式.节点检查器Web默认在端口8080上运行,调试器链接在端口5858上.