无法使用visual studio代码执行快速应用程序

时间:2017-05-12 16:52:00

标签: express visual-studio-code

我无法使用vscode运行新创建的快速项目。它只是失败并显示一条消息:“无法启动程序'xxxx';设置'outDir'属性可能会有所帮助。”

我的主要可执行文件位于bin / www

├── app.js
├── bin
│   └── www

使用vscode版本1.12.1

提交f6868fce3eeb16663840eb82123369dec6077a9b

日期2017-05-04T21:40:39.245Z

Shell 1.6.6

渲染器56.0.2924.87

节点7.4.0

on Linux 4.8.0-51-generic#54-Ubuntu SMP Tue Apr 25 16:32:21 UTC 2017 x86_64 x86_64 x86_64 GNU / Linux

这是我的launch.json文件:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceRoot}/bin/www",
            "protocol": "inspector"
        },
        {
            "type": "node",
            "request": "attach",
            "name": "Attach to Process",
            "address": "localhost",
            "port": 5858
        }
    ]
}

我该怎么办?

1 个答案:

答案 0 :(得分:1)

您的program值应指向您的快速脚本。像这样:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceRoot}/app.js",
            "protocol": "inspector"
        },
        {
            "type": "node",
            "request": "attach",
            "name": "Attach to Process",
            "address": "localhost",
            "port": 5858
        }
    ]
}