简体   繁体   English

可以将 Visual Studio Code 配置为使用 nodemon 启动吗

[英]Can Visual Studio Code be configured to launch with nodemon

I have installed nodemon as a global package in my system.我已经在我的系统中安装了nodemon作为全局包。 It works when I executed nodemon in cmd.它在我在 cmd 中执行nodemon时起作用。

But when I am using vscode with this launch.json file, vscode throws this exception:但是当我在这个launch.json文件中使用 vscode 时,vscode 会抛出这个异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件 XXX\\XXX\\XXX\\XXX\\nodemon 不存在

the launch.json is: launch.json 是:

{
"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当我在 runtimeExecutable 中擦除runtimeExecutable时,它与 node 完美运行

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

I have installed nodemon as a global package in my system.我已经在系统nodemon安装为全局软件包。 It works when I executed nodemon in cmd.当我在cmd中执行nodemon时,它可以工作。

But when I am using vscode with this launch.json file, vscode throws this exception:但是,当我在这个launch.json文件中使用vscode时,vscode抛出此异常:

request launch: runtime executable XXX\\XXX\\XXX\\XXX\\nodemon does not exists请求启动:运行时可执行文件XXX \\ XXX \\ XXX \\ XXX \\ nodemon不存在

the launch.json is: launch.json是:

{
"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当我抹去nodemin runtimeExecutable它与节点运行完全

It works fine for me, in the main Terminal.它在主终端中对我来说很好。 Do not use VS code terminal, use the main system terminal.不要使用 VS 代码终端,使用主系统终端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 vscode:使用nodemon启动时,无法使用Visual Studio代码中断任何断点 - vscode: Can't break on any breakpoint with Visual Studio code when launching with nodemon 用于带有Nodemon的Visual Studio的节点 - Node for Visual Studio with Nodemon 调试〜10秒后,Visual Studio代码nodemon ECONNREFUSED - Visual Studio Code nodemon ECONNREFUSED after ~10 s of debugging Visual Studio 代码中的发布后任务 - post launch task in visual studio code Visual Studio Code Node.js调试失败-请求``启动'':无法启动 - Visual studio code nodejs debug failure - request 'launch': cannot launch 无法获取Visual Studio代码在launch.json中运行我的构建命令 - Can't get Visual Studio Code to run my build command in launch.json 无法在 Visual Studio 代码中为“npx”启动的应用程序启动调试 - Unable to launch Debugging for a "npx" launched App in visual studio code Visual Studio Code - launch.json 和调试器卡在 Python 上 - Visual Studio Code - launch.json and debugger is stuck on Python 运行工头从视觉工作室代码launch.json开始 - Running foreman start through visual studio code launch.json 如何在launch.json的Visual Studio Code中反转${relativeFile}中的反斜杠? - How to reverse backslashes in ${relativeFile} in Visual Studio Code in launch.json?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM