title: Node.js spawn vlc child process not working in express
body: <p>I'm using node.js and express to create a controller of sorts for my home media centre that can be operated through a browser.</p>
  
  <p>I'm having a lot of trouble spawning the VLC process, but strangely only it works when executed from the node prompt, just not when run from file.</p>
  
  <p>Here is what I have tested:</p>
  
  <p>In the node command line/interpreter: <code>require('child_process').spawn('vlc');</code>
  This works as I would expect, I can see the vlc window opens and persists on screen.</p>
  
  <p>If I take the exact same line of code and I place it in another file (say test.js) and run that from the command line with <code>node test.js</code> nothing happens. Logging out the child process object a few seconds later gives me this:</p>
  
  <pre><code>{ _closesNeeded: 3,
    _closesGot: 3,
    signalCode: null,
    exitCode: 1,
    killed: false,
    _internal: null,
    pid: 11837,
    stdin:
     { _handle: null,
       _pendingWriteReqs: 0,
       _flags: 0,
       _connectQueueSize: 0,
       destroyed: true,
       bytesRead: 0,
       bytesWritten: 0,
       allowHalfOpen: undefined,
       writable: false,
       readable: false,
       _connecting: false,
       _connectQueue: null,
       _idleNext: null,
       _idlePrev: null },
    stdout:
     { _handle: null,
       _pendingWriteReqs: 0,
       _flags: 1,
       _connectQueueSize: 0,
       destroyed: true,
       bytesRead: 0,
       bytesWritten: 0,
       allowHalfOpen: undefined,
       writable: false,
       readable: false,
       _events: { close: [Function] },
       _connecting: false,
       _connectQueue: null,
       _idleNext: null,
       _idlePrev: null },
    stderr:
     { _handle: null,
       _pendingWriteReqs: 0,
       _flags: 1,
       _connectQueueSize: 0,
       destroyed: true,
       bytesRead: 215,
       bytesWritten: 0,
       allowHalfOpen: undefined,
       writable: false,
       readable: false,
       _events: { close: [Function] },
       _connecting: false,
       _connectQueue: null,
       _idleNext: null,
       _idlePrev: null } }
  </code></pre>
  
  <p>What is particularly weird about this is that I can launch other programs in the same way and it works. For instance replacing 'vlc' with 'gedit' results in the text editor appearing exactly as expected.</p>
  
  <p>Anyone got ideas as to what this could be?</p>