开发者

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

开发者 https://www.devze.com 2023-04-07 01:16 出处:网络
pipe(): Too many open files node.js:134 throw e; // process.nextTick error, or \'error\' event on first tick
pipe(): Too many open files

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: Error spawn开发者_JS百科ing

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号