zoukankan      html  css  js  c++  java
  • VSCode 如何运行调试全局安装的 Electron

    引用:https://blog.csdn.net/Likianta/article/details/89048938

    run.cmd 文件

    electron . --inspect=5858

    launch.json文件

    {
        // 使用 IntelliSense 了解相关属性。 
        // 悬停以查看现有属性的描述。
        // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                // "type": "node",
                // "request": "launch",
                // "name": "启动程序",
                // "skipFiles": [
                //     "<node_internals>/**"
                // ],
                // "program": "${workspaceFolder}/index.js",
                // "stopOnEntry": false, 
                // "args": [ ], 
                // "cwd": "${workspaceRoot}", 
                // "preLaunchTask": null, 
                // //"runtimeExecutable": "${workspaceRoot}/node_modules/electron/dist/electron.exe", 
                // //"runtimeExecutable": "D:/SoftWare/node-v14.16.0-win-x64/npm_global/node_modules/electron/dist/",
                // "runtimeExecutable": "${workspaceFolder}/run.cmd",
                // // "runtimeArgs": [
                // //     "--nolazy"
                // // ], 
                // //"runtimeArgs": ["."],
                // "env": {
                //     "NODE_ENV": "development"
                // }, 
                
                // //"externalConsole": false, 
                // "sourceMaps": false
                // //"outDir": null
                "type": "node",
                "request": "launch",
                "name": "Electron Main",
                // "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
                "runtimeExecutable": "${workspaceFolder}/run.cmd",  // 通过调用 run.cmd 启动
                "program": "${workspaceFolder}/index.js",
                "port": 5858
            }
        ]
    }

    注意:重启vscode

    之前会报:

    Can't find Node.js binary "node":path does not exist.Make sure Node.js is installed and in your PATH, or set the runtimeExecutable" in your launch.json

    原因是配置目录(runtimeExecutable)而不是exe

  • 相关阅读:
    MVC+jQuery开发B/S系统②:表单绑定
    插入排序
    笔记:实例管理
    文件读写冲突的解决办法:ReaderWriterLock
    MVC+jQuery数据绑定①:列表绑定(二)
    MVC+jQuery数据绑定①:列表绑定(三)
    非递归求 T(n) = [T(n1),n,T(n1)] 已知T1=[1]
    笔记:契约总结
    面试题:1~ n1 有n个数,是有序的,找出重复的那个数。
    Thread系列——ThreadPool
  • 原文地址:https://www.cnblogs.com/xiaoruilin/p/14614519.html
Copyright © 2011-2022 走看看