配置vs-code以在Ubuntu中调试电子

时间:2016-10-03 12:38:24

标签: node.js debugging visual-studio-code electron

我是nodejs的新手,并尝试使用电子制作桌面应用程序。我尝试在Ubuntu的vs-code中调试来自https://github.com/szwacz/electron-boilerplate的样板代码

这是我的launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Electron",
            "type": "node",
            "request": "launch",
            "program": "${workspaceRoot}/app/app.js",
            "stopOnEntry": false,
            "args": [],
            "cwd": "${workspaceRoot}",
            "preLaunchTask": null,
            "runtimeExecutable": "${workspaceRoot}/node_modules/electron-prebuilt/dist/electron",
            "runtimeArgs": [
                ".",
                "--enable-logging"
            ],
            "env": {
                "NODE_ENV": "development"
            },
            "console": "internalConsole",
            "sourceMaps": false,
            "outDir": null
        },
        {
            "name": "Attach",
            "type": "node",
            "request": "attach",
            "port": 5858,
            "address": "localhost",
            "restart": false,
            "sourceMaps": false,
            "outDir": null,
            "localRoot": "${workspaceRoot}",
            "remoteRoot": null
        },
        {
            "name": "Attach to Process",
            "type": "node",
            "request": "attach",
            "processId": "${command.PickProcess}",
            "port": 5858,
            "sourceMaps": false,
            "outDir": null
        }
    ]
}

我收到此错误:

Error: No such module: atom_browser_v8_util
    at Error (native)
    at process.atomBinding (/media/manoj/F6741AD7741A9B07/Node/Electrone/electron-boilerplate/node_modules/electron-prebuilt/dist/resources/electron.asar/common/init.js:5:20)
    at Object.<anonymous> (/media/manoj/F6741AD7741A9B07/Node/Electrone/electron-boilerplate/node_modules/electron-prebuilt/dist/resources/electron.asar/browser/api/browser-window.js:6:24)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)    
    at require (internal/module.js:20:19)

我哪里错了?

1 个答案:

答案 0 :(得分:0)