远程调试上承载AWS我节点的应用程序节点、应用程序、AWS

2023-09-11 10:49:57 作者:没你的笑我无法成眠

我想连接到我的节点服务器运行在调试模式下的AWS(节点--debug app.js)从我的开发机,并能够进行远程调试我的应用程序。

I would like to connect to my node server running in debug mode on AWS (node --debug app.js) from my development machine, and be able to debug my app remotely.

两个问题:

我能做到这一点与节点检查?我希望我可以,但节点检查无法安装在我的AWS实例。

Can I do this with node-inspector? I wish I could, but node-inspector fails to install on my AWS instance.

任何替代品,让我做到这一点?

Any alternatives that will allow me to do this?

推荐答案

使用ssh从您的开发mashine正向远程调试器端口

Forward remote debugger port with ssh from your dev mashine

SSH -L 5858:127.0.0.1:5858 ubuntu@some.ec2.host.com

ssh -L 5858:127.0.0.1:5858 ubuntu@some.ec2.host.com

现在你可以开始节点检查,如果调试器在本地运行

And now you can start node-inspector as if debugger is running locally