Reputation: 1493
So I am trying to setup remote debugging from my local machine to ec2 instance on Visual Studio Code. Getting an error:
launch.json file
{
// 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/"
}
]
}
ERROR:
Debugging with inspector protocol because Node.js version could not be determined (Error: connect ECONNREFUSED 52.182.32.72:3000)
Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: connect ECONNREFUSED 54.186.38.77:3000).
Additionally
What am I doing wrong? Please help!
Upvotes: 0
Views: 2094
Reputation: 374
To connect EC2 from VS Code you need to install sftp extension.
{
"name": "GIVE ANY NAME",
"host": "ec2-.........compute.amazonaws.com",
"protocol": "sftp",
"port": 22,
"username": "ec2-user",
"privateKeyPath": "SPECIFY YOUR PATH/FILENAME.pem",
"remotePath": "/",
"uploadOnSave": true
}
Upvotes: 2