u936293
u936293

Reputation: 16274

Where is stdout for VS Code?

I am running Node.js in VS Code. I see output of console.log in the Debug Window.

Where does process.stdout.write go to? I can't find it in the Debug Console or any of the Output windows.

My launch.json is simply this:

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

Upvotes: 20

Views: 17610

Answers (3)

JDawg
JDawg

Reputation: 9540

Make sure the Debug Console is visible:

Ctrl + Shift + Y

Upvotes: 3

Mark
Mark

Reputation: 182974

Looking at issues with process.stdout.write the suggested fixes are adding these to your launch config:

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

Especially the outputCapture entry is important.

Upvotes: 33

Akrion
Akrion

Reputation: 18525

Can you try to add "console": "internalConsole" to your config and see if it works?

As per the docs these are the available options for the console:

console - what kind of console to use, for example, internalConsole, integratedTerminal, externalTerminal

Upvotes: 2

Related Questions