NodeJs — debug with Nodemon in Visual Studio Code

Fred Wong
fredwong-it
Published in
1 min readMay 1, 2019

I want to debug my NodeJs code in Visual Studio Code. I can use Nodemon to do that.

I will need to install Nodemon first.

  1. click the left spider button
  2. click the upper setting button to open or create the launch.json
  3. type the follow configuration

4. go to package.json and add debug under the scripts block

5. run the script by: npm run debug

6. click debug tab

7. select Node: Nodemon to run

8. choose the correct process to attach

9. You can put your breakpoints in the NodeJs code now

--

--