0
pipe(): Too many open files

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: Error spawning

That's my error. My code is:

grep  = spawn 'ls' 

UPDATE

for tweet in indexedTweetsResults exec 'ls', (error, stdout, stderr) -> console.log stdout

This is my code and it errors with the pipe error. Any ideas?

Shamoon
  • 41,293
  • 91
  • 306
  • 570
  • **Possible Duplicate**: [Why can't I spawn a simple command with node.js?](http://stackoverflow.com/questions/6036093/too-many-open-files-when-using-nodejs-child-processes-spawn-to-run-scripts) – David Schwartz Sep 21 '11 at 19:32
  • 1
    wondering where you got that idea, it doesn't resemble any sample node code I've seen. @hvgotcodes has the right answer. – Fosco Sep 21 '11 at 19:53
  • Possible duplicate of [Execute a command line binary with Node.js](https://stackoverflow.com/questions/20643470/execute-a-command-line-binary-with-node-js) – iSkore Jul 27 '17 at 12:00

1 Answers1

1

YOu need to do

exec = require("child_process").exec

and then somewhere do

exec("ls", function(error, stdout, stderr) {
   // handle error, stdout, stderr
});

you have to write javascript....

hvgotcodes
  • 118,147
  • 33
  • 203
  • 236
  • Strange - I have this in a function that's called 2 functions in and it returns the error. If it's the only thing in the file, then it works fine – Shamoon Sep 21 '11 at 19:56