【发布时间】:2019-02-26 23:24:44
【问题描述】:
所以我试图在 Visual Studio Code 上设置从本地机器到 ec2 实例的远程调试。 遇到错误:
launch.json 文件
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to Remote",
"address": "ec2..........-west-2.compute.amazonaws.com",
"port": 3000,
"localRoot": "${workspaceFolder}",
"remoteRoot": "/home/ubuntu/"
}
]
}
错误:
使用检查器协议进行调试,因为无法使用 Node.js 版本 确定(错误:连接 ECONNREFUSED 52.182.32.72:3000)
无法连接到运行时进程,10000 毫秒后超时 - (原因: 无法连接到目标:连接 ECONNREFUSED 54.186.38.77:3000)。
另外
- 为了将 VS Code 与 ec2 连接,我需要设置一个项目吗 里面的文件夹先?
- 为此,我还需要先在 EC2 上安装 nodejs 吗?
我做错了什么?请帮忙!
【问题讨论】:
-
aws 实例入站安全组是否允许您在端口 3000 上的本地 ip 访问它?
-
是的,端口 3000 已打开,我可以访问它...即 public ip:3000 -> 显示.. 但是错误仍然存在!
标签: amazon-web-services amazon-ec2 visual-studio-code remote-debugging