微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javascript – 如何使用节点检查器与sails.js?

我想调试我的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上.

原文地址:https://www.jb51.cc/js/155074.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐