当前位置 : 主页 > 网页制作 > Nodejs >

node.js – 配置vs-code以在Ubuntu中调试电子

来源:互联网 收集:自由互联 发布时间:2021-06-16
我是nodejs的新手,并尝试使用电子制作桌面应用程序.我尝试在Ubuntu的vs-code中调试 https://github.com/szwacz/electron-boilerplate的样板代码 这是我的launch.json: { "version": "0.2.0", "configurations": [ { "
我是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)

我哪里错了?

我遇到了同样的问题,但只是通过更改项目文件夹名称解决了问题.虽然我不知道发生了什么,但你可能会尝试一下.
网友评论