Remotely debugging my node app that is hosted on AWS

前端 未结 7 515
别那么骄傲
别那么骄傲 2021-01-29 21:10

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 quest

7条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-29 21:22

    Allow me to present an alternative using node --inspect. I had the same need, although in a Windows environment, I believe this should work for you.

    Remote machine (tested with Node 6.10.2, Windows Server 2012)

    node --inspect=0.0.0.0:9229 .js

    Local Machine (tested with Win 10, Chrome 60.0.3112.90)

    In Chrome DevTools - Click the vertical ellipsis menu in top right:

    1. Go to: More Tools -> Remote Devices
    2. Under Network targets Click Add address
    3. Enter :9229
    4. Once you enter address and remote target is connected you'll see Node.JS Icon on Top Left of DevTools
    5. Click NodeJS Logo to launch DevTools Node Debugger

    Screenshots of Steps 1,3,4 below.

提交回复
热议问题