jorangreef / sudo-prompt

Run a command using sudo, prompting the user with an OS dialog if necessary.
MIT License
480 stars 119 forks source link

Unexpected behaviour with linux - electron.js #139

Open sidhdharth-navsoft opened 3 years ago

sidhdharth-navsoft commented 3 years ago
var sudo = require('sudo-prompt');
    var options = {
        name: 'Electron',
        icns: '/Applications/Electron.app/Contents/Resources/Electron.icns', // (optional)
    };
    sudo.exec('apt-get install build-essential libudev-dev', options,
        (error, stdout, stderr) =>{

            if (error) throw error;
            log.info('stderr: '  + stderr);
            log.info('stdout: '  + stdout);
            //mainfunction();   

        }

        );

after running this function -> promt opening -> giving password --> and while using printer its showing error libudev-dev', not installed error which is intalled by use same command -->"sudo.exec('apt-get install build-essential libudev-dev', options,"

in stdout -- getting this -- stdout: Reading package lists... Building dependency tree... Reading state information... build-essential is already the newest version (12.4ubuntu1). libudev-dev is already the newest version (237-3ubuntu10.44). The following packages were automatically installed and are no longer required: efibootmgr gir1.2-geocodeglib-1.0 gyp javascript-common libc-ares2 libegl1-mesa libfwup1 libhttp-parser2.7.1 libjs-async libjs-inherits libjs-jquery libjs-node-uuid libjs-underscore libllvm8 libssl1.0-dev libuv1 libuv1-dev libwayland-egl1-mesa node-abbrev node-ansi node-ansi-color-table node-archy node-async node-balanced-match node-block-stream node-brace-expansion node-builtin-modules node-combined-stream node-concat-map node-cookie-jar node-delayed-stream node-forever-agent node-form-data node-fs.realpath node-fstream node-fstream-ignore node-github-url-from-git node-glob node-graceful-fs node-gyp node-hosted-git-info node-inflight node-inherits node-ini node-is-builtin-module node-isexe node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once node-osenv node-path-is-absolute node-pseudomap node-qs node-read node-read-package-json node-request node-retry node-rimraf node-semver node-sha node-slide node-spdx-correct node-spdx-expression-parse node-spdx-license-ids node-tar node-tunnel-agent node-underscore node-validate-npm-package-license node-which node-wrappy node-yallist nodejs-doc python-pkg-resources ubuntu-web-launchers Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.

sidhdharth-navsoft commented 3 years ago

using escpos library for printing