Skip to content

Error Uncaught Exception: TypeError: Sudoer is not a constructor #62

@duongtungls

Description

@duongtungls

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions