I use example code on Electron main thread but get back error
Uncaught Exception: TypeError: Sudoer is not a constructor
const {Sudoer} = require('electron-sudo')
let options = {name: 'electron sudo application'},
sudoer = new Sudoer(options);
/* Spawn subprocess behavior */
let cp = await sudoer.spawn(
'echo', ['$PARAM'], {env: {PARAM: 'VALUE'}}
);
cp.on('close', () => {
/*
cp.output.stdout (Buffer)
cp.output.stderr (Buffer)
*/
});
Please help figure out where is problem. thanks