'Unknown stdin file type' error in windows 'Unknown stdin file type' error in windows windows windows

'Unknown stdin file type' error in windows


I encountered the same problem.

First I thought that devtool as REPL does not need stdin and was a simple bug in windows build. GitHub repo owners fix it just ignoring stdin on startup but, as you had discovered, devtool is broken and you can not do anything with stdin in windows.

As a proof of concept I create a simple example beyond devtool REPL:

This piece of code does not work.

//test.jsvar readline = require('readline');var rl = readline.createInterface({  input: process.stdin,  output: process.stdout,  terminal: true});rl.on('line', function(line){    console.log(line);})

devtool test.js < input.txt

Error: Implement me. Unknown stdin file type!

Windows 7 x64, S.O. Admin rights, Node v5.10.0, npm v3.8.3 DevTool v1.9.1.

I had left a comment in your github issue but is closed so I opened a new one.


There is another question pointing to the same problem. One of the comments states that it's a known iisnode issue and also suggests a work around by wrapping all calls to process.stdin like:

if(!process.env.IISNODE_VERSION) {     // do stuff with process.stdin }

It can be a temporary solution. I'm sure you've already taken a look to that post, what do you think?


Reading through the libuv source code which is what nodejs uses for certain low-level operations, seems that the reason is that the type of buffer or handle cannot be determined specifically for windows. The GetFileType function seems to return an unknown handle.

This is definitely a windows only issue because the part of the library that determines the type of handle is within src/win/handle.c of the UV source code so I don't think this affects *NIX OS'es indeed.

Maybe the installed nodejs version is missing a build-time option?