Issues with node.js

Marco Righele marco at righele.it
Tue Jul 28 16:38:01 PDT 2015


Greetings,

is anybody using node.js with DragonFlyBSD ?
I have a strange issue when I spawn it from another instance of node.js.
A simple JS example:

     var spawn = require('child_process').spawn;
     var call = spawn('node', ['--eval', 'console.log("Hello World");']);
     call.stdout.on('data', function(data) {
         console.log(data.toString());
     });
     call.stderr.on('data', function(data) {
         console.log(data.toString());
     });


The expected result is a line like the following.

     Hello World

Instead I get the following error:

     node.js:486
             throw new Error('Implement me. Unknown stream file type!');
                   ^
     Error: Implement me. Unknown stream file type!
         at createWritableStdioStream (node.js:486:15)
         at process.stdout (node.js:502:16)
         at console.js:111:37
         at NativeModule.compile (node.js:805:5)
         at Function.NativeModule.require (node.js:774:18)
         at node.js:214:27
         at [eval]:1:27
         at Object.exports.runInThisContext (vm.js:74:17)
         at Object.<anonymous> ([eval]-wrapper:6:22)
         at Module._compile (module.js:460:26)


The problem lies in the function uv_guess_handle of libuv [1], where the 
standard input
of the child process is recognized as a stream of weird family, AF_ECMA 
(!).
The same code works correctly in FreeBSD, where the stream is a regular 
AF_UNIX stream.

My guess is that there are a few assumptions in the FreeBSD specific 
code that are no longer true for DragonFlyBSD,
The problem seems to be specific to a node-spawning-node scenario.

Any suggestion ?

DragonFly version is 4.2.1
Node.js version is 0.12.6

Marco


[1] 
https://github.com/joyent/node/blob/v0.12.6-release/deps/uv/src/unix/tty.c




More information about the Users mailing list