node.js - node exec 执行没反应
天蓬老师
天蓬老师 2017-04-17 15:38:32
0
1
891
const exec = require('child_process').exec;
          exec('cat /dev/urandom |od -x|head -n 1', (error, stdout, stderr) => {
            if (error) {
              console.error(`exec error: ${error}`);
              return;
            }
            console.log(`stdout: ${stdout}`);
            console.log(`stderr: ${stderr}`);
          });

为什么执行这段语句,完全没反应?

而在终端执行完全正常。

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
洪涛

The default maximum allowed amount of data output to stdout and stderr by exec does not exceed 200K. If it exceeds, the child process will be killed.

Here, let me give you a door https://segmentfault.com/q/10...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template