skip to Main Content

I’m using Visual Studio Code to run ExpressJs in debug mode.

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}\nodemon server.js"
        }
    ]
}

I’m getting the following error when I start debugging.

enter image description here

If I run nodemon server.js in the terminal it works. The above error only appears when using Visual Studio Code debugging. I have tried the the following:

  1. Remove node_modules and reinstall node_modules
  2. Reinstall nodemon globally

2

Answers


  1. Chosen as BEST ANSWER

    I ended up using Visual Studio Code "JavaScript Debug Terminal". In the terminal I run command nodemon server.js and it works.


  2. You need to update this code line

    "program": "${workspaceFolder}\nodemon server.js"
    

    to

    "program": "nodemon ${workspaceFolder}server.js"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search