electron-sudo
electron-sudo copied to clipboard
The "file" argument must be of type string. Received type object
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:
This error also affects me, and also happens when using sudoer.exec.
Looks like it might have been fixed in this pr: https://github.com/automation-stack/electron-sudo/pull/41
I attempted to merge some of the prs myself here: https://github.com/peterupton/electron-sudo
will still facing the issue in 2022