Shamoon
Shamoon

Reputation: 43501

Why can't I spawn a simple command with node.js?

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?

Upvotes: 0

Views: 505

Answers (1)

hvgotcodes
hvgotcodes

Reputation: 120198

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....

Upvotes: 1

Related Questions