I follow the usage (Version 4.0.*) , and I use electron-sudo@4.0.12 , my test.js is below:
var Sudoer = require('electron-sudo').default;
let options = {name: 'electron sudo application'};
var sudoer = new Sudoer(options);
sudoer.spawn('cmd.exe', ['echo', 'hello']).then(function (cp) {
cp.stdout.on('data', (msg) => {
console.log('Looks like we have a message on STDOUT');
console.log(err.toString('utf8'));
});
cp.stderr.on('data',(err) => {
console.log('Looks like we have a message on STDERR');
console.log(err.toString('utf8'));
});
I follow the usage (Version 4.0.*) , and I use electron-sudo@4.0.12 , my test.js is below:
var Sudoer = require('electron-sudo').default; let options = {name: 'electron sudo application'}; var sudoer = new Sudoer(options);
sudoer.spawn('cmd.exe', ['echo', 'hello']).then(function (cp) { cp.stdout.on('data', (msg) => { console.log('Looks like we have a message on STDOUT'); console.log(err.toString('utf8')); });
cp.stderr.on('data',(err) => { console.log('Looks like we have a message on STDERR'); console.log(err.toString('utf8')); });
cp.on('close',() => { console.log('Processed Finished!'); }); });
But the result is:
Please help me to point out What's wrong with my usage. Thx
I found some relative issue #47, so closed.