我想调试我的sails.js应用程序,但我不知道该如何启动node-inspector
。
通常它会:
$ node --debug myapp.js
如果我正常运行帆应用程序:
$ sails lift --prod
然后启动 node-inspector
$ 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 lift
使用节点app.js
在调试模式下启动。默认情况下,节点检查器Web在端口上运行,8080
调试器链接在端口上5858
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句