electron node.js 在 vscode 设置 调试 Debug

在当前工程下,添加一个 .vscode/launch.json 文件

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "cwd": "${workspaceRoot}",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
        "windows": {
          "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
        },
        "args" : ["."],
        "outputCapture": "std"
        }
    ]
}

或者使用快捷键F5,然后选择Node.js,会自动生成该文件
接下来,就可以点击菜单Debug -> Start Debugging,也可以直接按快捷键F5,启动程序

原文地址:https://www.cnblogs.com/abc789/p/12001513.html

时间: 2024-08-03 08:28:32

electron node.js 在 vscode 设置 调试 Debug的相关文章

在Visual Studio上开发Node.js程序(2)——远程调试及发布到Azure

[题外话] 上次介绍了VS上开发Node.js的插件Node.js Tools for Visual Studio(NTVS),其提供了非常方便的开发和调试功能,当然很多情况下由于平台限制等原因需要在其他机器上运行程序,进而需要远程调试功能,不过还好,NTVS提供的远程调试也非常方便. [系列索引] 在Visual Studio上开发Node.js程序——NTVS介绍及使用 在Visual Studio上开发Node.js程序(2)——NTVS远程调试及发布到Azure [文章索引] NTVS远

Node.js在Chrome进行调试

在开发node.js环境时候,调试是一件很疼苦的事情,不过随着时代不断发展,先如今已经有很多种node环境代码调试方式,今天我就笔记一下我使用的方式 node-inspector: node-inspector通过Web网页与用户进行交互,一个基于WebKit内核的浏览器,如Chrome, Safari,或者 Maxthon(遨游浏览器).QQ浏览器.搜狗浏览器等 想要调试首先安装node-inspector:         1. npm install -g node-inspector  

(四)、node.js对于程序的调试

Node.js 支持命令行下的单步调试.下面是一个简单的程序: var a = 1; var b = 'world';  var c = function(x) {   console.log('hello ' + x + a); }; c(b); 在命令行下执行 node debug debug.js,将会启动调试工具: Node.js 调试命令 输入 n 表示下一行 输入 sb('debug.js', 4) 表示在函数的第四行设置断点 使用elipse调试 在使用 Eclipse 之前,首先

electron node.js 实现文件拖动读取文件

css/styles.css 1 .for_file_drop { 2 width: 100%; 3 height: 100px; 4 background-color: blueviolet; 5 } index.html 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 6 <title>Hello World!</title> 7 &

Mac 下搭建环境 homebrew/git/node.js/npm/vsCode...

主要记录一下homebrew/git/node.js/npm的命令行安装 很简单,下面开始: 1. homebrew  也是一个包管理工具: mac 里打开终端命令行工具,粘下面一行回车, /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2. git: 同样接着在终端里输入以下回车安装git brew install git 检查git当

node.js调试

不用每次都重启服务的supervisor 使用过PHP的同学肯定都清楚,修改了某个脚本文件后,只要刷新页面服务器就会加载新的内容,但是node.js在第一次引用到某个文件解析后会 将其放入内存,下次访问的时候直接在内存中获取,以提高效率,但是这对我们开发造成一定困扰,修改了某个module后只能重启服务器后才能生效,调试起 来效率还是很低的. 于是乎node.js中有了supervisor插件帮我们坚实文件改动,自动重启服务器,supervisor是node.js的一个包,安装起来很简单,使用n

Node.js调试技巧

作者:zhanhailiang 日期:2014-11-23 1. console.log 跟前端调试相同,通过一步步打印相关变量进行代码调试 2. 使用Node.js内置的调试器 通过node debug xxx.js来进行调试: [root@~/wade/nodejs/professional-nodejs/chapter18]# node debug app_with_bug.js < debugger listening on port 5858 connecting... ok debu

使用PHPStorm调试Node.js代码

Node.js出来也有一段时间了,是时候拿来做点东西啦,虽然还没有到1.0版本,但是应该也快了. 安装 不得不说,作为后期之秀,各种工具做得还不错,安装Node也是,就是几分钟的事情,有个叫做NVM的东西,Windows下对应的是NVMW,用来安装Node,想安几个版本都是不费力啊.开始安装: git clone git://github.com/hakobera/nvmw.git "%HOMEDRIVE%%HOMEPATH%.nvmw" set "PATH=%HOMEDRI

用node-inspector调试Node.js(转自NOANYLOVE&#39;S BLOG)

原文地址:http://www.noanylove.com/2011/12/node-the-inspector-debugging-node-js/ 用node-inspector调试Node.js 2011年12月15日 | 标签: JavaScript, Node.js, 调试 重要:因为node和node-inspector更新了的缘故,现在的界面有一些不同,抽空我会更新一下.另外,下面的debug参数前应该是两个“-”,不知道为什么显示出来只有一个“-”.比较郁闷. 据说,一个程序员一