I don't understand why running the tcpdump program doesn't work but with other commands and programs it does, for example: Ping, openSSL, ...
When I run it for example with Ping and OpenSSL, data appears in the console, but tcpdump does nothing, it just ends and that's it.
Somebody could help me? Thanks.
const {spawn} = require('child_process');
spawn('tcpdump', ['-D']).stdout.on('data', (data) => console.log(data.toString()))
//spawn('ping', ['127.0.0.1']).stdout.on('data', (data) => console.log(data.toString()))
//spawn('openssl', ['req', '-x509', '-newkey','rsa:4096','-keyout', 'key.pem', '-out', 'cert.pem', '-days', '365']).stdout.on('data', (data) => console.log(data.toString()))