Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VScode node debugger throws Uncaught Error: write EPIPE

Whenever I try to run the debugger, I keep getting this error:

VScode debugger console error

This is the debug configurations:

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

---- Update ----

I am using VScode version 1.49.0

like image 828
sdclarkelab Avatar asked Oct 24 '25 15:10

sdclarkelab


1 Answers

As @S.Clarke876 mentioned, it appears to be a bug in VS Code, that should be fixed in the next release. See: https://github.com/microsoft/vscode/issues/106484#issuecomment-691202789

You can work around the issue by adding "outputCapture": "std" to your launch.json file.

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

Worked for me! It only appeared to happen when the npm package debug attempted to write out to the console. I.e. console.log was fine.

Thanks again, @S.Clarke876! Only adding this answer as I nearly missed your comment.

like image 191
Locdarb Avatar answered Oct 26 '25 07:10

Locdarb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!