简体   繁体   中英

Can Visual Studio Code be configured to launch with nodemon

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

I have installed nodemon as a global package in my system. It works when I executed nodemon in cmd.

But when I am using vscode with this launch.json file, vscode throws this exception:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists

the launch.json is:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch",
        "type": "node",
        "request": "launch",
        "program": "app.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": ".",
        "runtimeExecutable": nodemon,
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        },
        "externalConsole": false,
        "preLaunchTask": "",
        "sourceMaps": false,
        "outDir": null
    },
    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 5858
    }
]
}

when I erase the nodemin in runtimeExecutable it runs perfectly with node

It works fine for me, in the main Terminal. Do not use VS code terminal, use the main system terminal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM