Can Visual Studio Code be configured to launch with nodemon

First, install nodemon as a dev dependency:

npm install --save-dev nodemon

For newer versions of VS Code set up your .vscode/launch.json file like this:

{
    "version": "0.2.0",
    "configurations": [
    {
        "type": "node",
        "request": "launch",
        "name": "nodemon",
        "runtimeExecutable": "${workspaceFolder}/node_modules/nodemon/bin/nodemon.js",
        "program": "${workspaceFolder}/app.js",
        "restart": true,
        "console": "integratedTerminal",
        "internalConsoleOptions": "neverOpen"
    }]
}

The most important pieces are the runtimeExecutable property that points to the nodemon script and the program property that points to your entry point script.

If you use an older VS Code (which you shouldn’t), try this launch configuration:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch with nodemon",
      "type": "node",
      "request": "launch",
      "program": "${workspaceRoot}/node_modules/nodemon/bin/nodemon.js",
      "args": ["${workspaceRoot}/app.js"],
      "runtimeArgs": ["--nolazy"]
    }
  ]
}

The most important pieces are the program property that points to the nodemon script and the args property that points to your normal entry point script.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)