【问题标题】:Where is stdout for VS Code?VS Code 的标准输出在哪里?
【发布时间】:2018-08-12 16:08:55
【问题描述】:

我在 VS Code 中运行 Node.js。我在调试窗口中看到了console.log 的输出。

process.stdout.write 去哪儿了?我在调试控制台或任何输出窗口中都找不到它。

我的 launch.json 就是这样的:

"configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "program": "${workspaceFolder}/job.js"
    }
  ]
}

【问题讨论】:

  • 你能发布你的调试配置部分吗?
  • 我已添加launch.json。不确定这是否是您的意思。

标签: visual-studio-code


【解决方案1】:

查看issues with process.stdout.write,建议的修复将这些添加到您的启动配置中:

"console": "internalConsole", 
"outputCapture": "std",

尤其是 outputCapture 条目很重要。

【讨论】:

  • 4me 只需 "outputCapture":"std" 就足够了
【解决方案2】:

确保调试控制台可见:

Ctrl + Shift + Y

【讨论】:

    【解决方案3】:

    您可以尝试将"console": "internalConsole" 添加到您的配置中,看看它是否有效?

    As per the docs 这些是console 的可用选项:

    console - 使用什么样的控制台,例如,internalConsole集成终端外部终端

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-22
      • 2015-07-09
      • 2015-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-20
      • 1970-01-01
      相关资源
      最近更新 更多