【问题标题】:VScode node debugger throws Uncaught Error: write EPIPEVScode 节点调试器抛出 Uncaught Error: write EPIPE
【发布时间】:2020-09-11 17:29:54
【问题描述】:

每当我尝试运行调试器时,我都会不断收到此错误:

这是调试配置:

{
 "version": "0.2.0",
 "configurations": [
  {
   "type": "node",
   "request": "launch",
   "name": "Launch Program",
   "program": "${workspaceFolder}/server/bin/www",
   "envFile": "${workspaceRoot}/server/.env"
  }
 ]
}

----更新----

我使用的是 VScode 版本 1.49.0

【问题讨论】:

标签: node.js debugging visual-studio-code


【解决方案1】:

正如@S.Clarke876 提到的,这似乎是 VS Code 中的一个错误,应该在下一个版本中修复。见:https://github.com/microsoft/vscode/issues/106484#issuecomment-691202789

您可以通过将"outputCapture": "std" 添加到您的launch.json 文件来解决此问题。

{
 "version": "0.2.0",
 "configurations": [
  {
   "type": "node",
   "request": "launch",
   "name": "Launch Program",
   "program": "${workspaceFolder}/server/bin/www",
   "envFile": "${workspaceRoot}/server/.env",
   "outputCapture": "std"
  }
 ]
}

为我工作!它似乎只在 npm 包debug 尝试写出到控制台时发生。 IE。 console.log 很好。

再次感谢@S.Clarke876!仅添加此答案,因为我几乎错过了您的评论。

【讨论】:

    猜你喜欢
    • 2019-03-15
    • 2022-11-22
    • 1970-01-01
    • 2021-07-23
    • 2019-08-15
    • 2019-09-17
    • 2019-05-02
    • 2020-06-21
    • 2019-04-11
    相关资源
    最近更新 更多