DEV Community

LG
LG

Posted on • Edited on

1 1

I/O redirections on Node.js via Git Bash for Windows (Windows-users oriented)

NOTE : First of all this live document oriented to Windows users as we consider ourselves using Git bash for Windows !

node.exe --inspect=[127.0.0.1:port] # herein 127.0.0.1 roughly equals to localhost ; also [angle brackets must be omitted , used just to emphasize]
Enter fullscreen mode Exit fullscreen mode

[All credits to: Marco Eckstein & Phu Ngo]

Question is why we need .exe rather than default node, is because on Git Windows (let me emphasize – WINDOWS) a node command for e.g. node file_name.js invokes itself through aliased winpty resulting in "side effects (architectural quirks?)" of IO redirections / piping being unrecognized as a part of tty usually resulting in stderr message on terminal such as :

stdin: is not a tty

...

Much more of practical examples on I/O redirections or piping coming soon on this live document, stay tuned !

AWS Q Developer image

Your AI Code Assistant

Generate and update README files, create data-flow diagrams, and keep your project fully documented. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Postgres on Neon - Get the Free Plan

No credit card required. The database you love, on a serverless platform designed to help you build faster.

Get Postgres on Neon

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay