title: NodeJS - how to get spawned child to communicate with parent?
body: <p>I'm trying this out:</p>
  
  <pre><code>var child = spawn('node', args, {cwd: parentDir, stdio: 'ipc'} );
  </code></pre>
  
  <p>(args is an array of parameters)</p>
  
  <p>but it gives the following error: </p>
  
  <blockquote>
    <p>TypeError: Incorrect value of stdio option: ipc</p>
  </blockquote>
  
  <p>This actually works, so the problem seems indeed to be the stdio ipc parameter:</p>
  
  <pre><code>var child = spawn('node', args, {cwd: parentDir} );
  </code></pre>
  
  <p>This also works:</p>
  
  <pre><code> var child = spawn('node', args, {cwd: parentDir, stdio: 'pipe'} );
  </code></pre>
  
  <p>I read this: <a href="http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options" rel="noreferrer">http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options</a>
  but I don't see where I am going wrong. This is the first time I try to use this NodeJS functionality so I am sorry if the problem is evident.</p>
  
  <p>Maybe there is some other way to solve the problem. The child has to be spawned and not forked and I simply want to be able to send messages from the child to the parent.</p>
  
  <p>Thank you!!</p>
  
  <p>EDIT: I have Node v0.8.18. I searched version history for IPC <a href="http://nodejs.org/changelog.html" rel="noreferrer">http://nodejs.org/changelog.html</a> and there's nothing with search term "IPC" that makes me think that I need a newer version of NodeJS.</p>