如何使用PHPStorm远程调试Node

如何使用PHPStorm远程调试Node

本文介绍了如何使用PHPStorm远程调试Node JS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个Windows框和一个运行CentOS的虚拟机。有没有人碰巧知道如何使用PHPStorm调试节点CLI脚本(不打开端口)? 解决方案确保你有 nodejs plugin 。 如果您的服务器具有可用的平衡器包(我的EC2框没有),您可以使用本教程转发带有平衡器的端口。 yum install balance -yt balance -df 8585 127.0.0.1.5858 许多报告成功与一个iptables重定向从eth0到lo(不适合我)这样: iptables -t nat -A PREROUTING -p tcp -m tcp -i eth0 --dport 5858 -j DNAT --to 127.0.0.1:5858 还有一个简单的节点脚本在这个eclipse调试tut (在底部附近)描述,这将隧道你的本地调试到远程主机。 但是一旦我那么远路径,我没有看到,因为我熟悉SSH。所以最终,我使用了SSH隧道,并设置了PHPStorm来调试localhost。 I have a windows box and a VM running CentOS. Does anyone happen to know how I can debug a node CLI script (which doesn't open a port) using PHPStorm? The "edit configuration" seems to only support connecting somewhere instead of listening for incoming connections. 解决方案 Make sure you have the nodejs plugin installed.If your server has the balancer package available (my EC2 box didn't), you can use this tutorial to forward the port with balancer.yum install balance -ytbalance -df 8585 127.0.0.1.5858Many report success with an iptables redirect from eth0 to lo (didn't work for me) like this:iptables -t nat -A PREROUTING -p tcp -m tcp -i eth0 --dport 5858 -j DNAT --to 127.0.0.1:5858There is also a simple node script described in this eclipse debugging tut (near the bottom), that will tunnel your local debug to a remote host.But once I was that far down the path, I didn't see the point as I'm familiar with SSH. So ultimately, I went with an SSH tunnel and set up PHPStorm to debug localhost. 这篇关于如何使用PHPStorm远程调试Node JS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-24 08:12