DEV Community

Lukas Gaucas
Lukas Gaucas

Posted on • Updated on

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 !

Top comments (0)