【问题标题】:VS Code - Node breakpoint is unboundVS Code - 节点断点未绑定
【发布时间】:2020-12-06 12:32:39
【问题描述】:

我在一个无服务器项目(节点)中工作,我无法使用 VS 代码设置断点(始终未绑定):

Version: 1.48.0
Commit: db40434f562994116e5b21c24015a2e40b2504e6
Date: 2020-08-13T07:40:55.768Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.4.0-42-generic

这是我的 launch.json 文件:

{
    "version": "0.2.0",
    "configurations": [
     {
      "name": "Debug",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "runtimeExecutable": "npm",
      "runtimeArgs": [
       "run-script",
       "debug"
      ],
      "port": 5858
     }
    ]
   }

应用程序正在调试模式下启动,但我无法添加任何断点。有什么解决方法吗?

【问题讨论】:

    标签: node.js visual-studio-code node-modules serverless


    【解决方案1】:

    对我有用的解决方法是:

    • 打开扩展视图(ctrl+shift+x)并搜索@builtin @id:ms-vscode.js-debug
    • 右键单击 JavaScript 调试器扩展并将其禁用。
    • 在扩展视图中搜索@id:ms-vscode.js-debug-nightly
    • 安装该扩展。

    打开您的 settings.json (users/[user]/Appdata/roaming/code/user/) 并添加:

    "debug.javascript.usePreview": false
    

    希望它对你有用。

    【讨论】:

      猜你喜欢
      • 2021-02-11
      • 2021-10-15
      • 2021-10-05
      • 2022-12-23
      • 2018-11-21
      • 2021-02-24
      • 2022-12-22
      • 1970-01-01
      相关资源
      最近更新 更多