electron-sudo icon indicating copy to clipboard operation
electron-sudo copied to clipboard

The "file" argument must be of type string. Received type object

Open ghost opened this issue 5 years ago • 4 comments

    sudoer.spawn(
        'resolvconf -u'
    )
        .catch(err => {
            console.error(err);
        });

Throws this error

TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
    at validateString (internal/validators.js:112:11)
    at normalizeSpawnArguments (child_process.js:407:3)
    at Object.spawn (child_process.js:543:16)

Using

    sudoer.spawn(
        'resolvconf', ['-u']
    )
        .catch(err => {
            console.error(err);
        });

does not solve the problem :bug:

ghost avatar Jul 31 '20 10:07 ghost

This error also affects me, and also happens when using sudoer.exec.

peterupton avatar Feb 02 '21 17:02 peterupton

Looks like it might have been fixed in this pr: https://github.com/automation-stack/electron-sudo/pull/41

peterupton avatar Feb 02 '21 17:02 peterupton

I attempted to merge some of the prs myself here: https://github.com/peterupton/electron-sudo

peterupton avatar Feb 02 '21 20:02 peterupton

will still facing the issue in 2022

Paula2001 avatar Feb 01 '22 11:02 Paula2001