Question: 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.

Two questions:

* 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?

Answer: 
Forward remote debugger port with ssh from your dev machine

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

```

And now you can start `node-inspector` as if the debugger is running locally.
You can use `node --inspect` too in your remote machine. 

1. Start your node with `node --inspect myapp.js`
2. Then locally `ssh -L 9229:127.0.0.1:9229 myuser@myserver -N`
3. Search for an string like this at the log head and copy it
`chrome-devtools://devtools/remote/serve_file/@60cd6e859b9ff284980/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/bef2ae68`
4. Paste it in your chrome browser

Enjoy :)

If you are using `pm2` just add this on your ecosystem.js 

```
"apps": [{
    "name": "myapp",
    "script": "index.js",
    "node_args": ["--inspect"],
...

```