Using simple commands like ls, pwd and even open an external application I have success using child process, but when using exec with a docker command in a built electron app, I get this error:
exec Error: Command failed: docker exec -it 6bec55e9e86e touch home.html
the input device is not a TTY
Here is the code:
var exec = require('child_process').exec;
exec('docker exec -it 6bec55e9e86e touch casa.html', function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
please remove -t flag. so you command should be docker exec -i 6bec55e9e86e touch casa.html.
this error the input device is not a TTY mean your input device is not a Teletypes(terminal), and in the commands of docker, -t flag symbols a terminal, so they are conflict. so just remove it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With