nodejs 调试,在官方文档(英文),常用的两种:

  • 一个在chrome安装插件inspector
  • 第二种利用编辑

这里我使用vscode编辑来调试。

主要是配置 launch.json(用vscode打开项目是,会生成.vscode文件,launch.json就在里面),

launch.json配置如下:

{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Electron Main",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"program": "${workspaceFolder}/main.js",
"protocol": "legacy"
},
{
"type": "node",
"request": "launch",
"name": "Current file",
"program": "${file}",
"cwd": "${cwd}"
},
]
}

文档

完这两篇调试,vscode调试模式和chrome对普通js断点调试差不多:

效果图

最新文章

  1. 初学者 bootstrap(二)----在路上(4)
  2. (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about t
  3. 设计模式学习之简单工厂(Simple Factory,创建型模式)(1)
  4. Ghostscript命令实践
  5. Java客户端通过Http发送POST请求上传文件到web服务器
  6. Cygwin之SSH服务安装过程问题
  7. c语言实现tree数据结构
  8. Pelican主题配置:elegant
  9. css 绝对居中
  10. 【转载】扩展Robot Framework,实现失败用例自动再执行(失败重跑)
  11. Luogu P1410 子序列
  12. windows安装oracle-odbc驱动错误原因
  13. 对数log
  14. IGMP协议
  15. Hadoop MapReduce编程 API入门系列之Crime数据分析(二十五)(未完)
  16. Eclipse SVN 合并分支/主干
  17. restframework api(基础3CBV)
  18. Elasticsearch学习(4) spring boot整合Elasticsearch的聚合操作
  19. C++ Arithmetic Exception
  20. 登陆Oracle EBS的Form遇到问题Internet Explorer has modified this page to help prevent cross-site scripting

热门文章

  1. [原创]MSP430FR4133练习(一):GPIO输入电平状态判断
  2. java对象与map对象相互转换
  3. 面试Spring之bean的生命周期
  4. golang获取命令行参数
  5. react给一个div行内加背景图片并实现cover覆盖模式居中显示
  6. 针对phpStudy网站服务器的入侵
  7. [Stats385] Lecture 03, Harmonic Analysis of Deep CNN
  8. freemarker特殊字符转义
  9. day_4_25 py
  10. robot framework教程-------虫师