Skip to content

exec command not working. Showing "shell.js : internal error" in nwjs #248

@dvenkatsagar

Description

@dvenkatsagar

Im trying to do a basic command taken from the documentation.

var version = exec('node --version', {silent:true}).output;

and it shows the following output

[23008:1031/205417:INFO:CONSOLE(191)] ""shell.js: internal error"", source: /home/sagar/Repositories/Scripts/Projects/node/ubic/ubic/node_modules/shelljs/src/common.js (191)
[23008:1031/205417:INFO:CONSOLE(192)] ""Error: ENOENT: no such file or directory, open '/tmp/shelljs_7712d2f4992c056323b3'\n    at Error (native)\n    at Object.fs.openSync (fs.js:540:18)\n    at Object.fs.readFileSync (fs.js:392:15)\n    at execSync (/home/sagar/Repositories/Scripts/Projects/node/ubic/ubic/node_modules/shelljs/src/exec.js:109:24)\n    at Object._exec (/home/sagar/Repositories/Scripts/Projects/node/ubic/ubic/node_modules/shelljs/src/exec.js:214:12)\n    at Object.exec (/home/sagar/Repositories/Scripts/Projects/node/ubic/ubic/node_modules/shelljs/src/common.js:182:23)\n    at file:///home/sagar/Repositories/Scripts/Projects/node/ubic/ubic/main.js:34:21"", source: /home/sagar/Repositories/Scripts/Projects/node/ubic/ubic/node_modules/shelljs/src/common.js (192)

Can some one please help me out? I just don't understand where Im going wrong. It works fine when I use the asynchronous way.

Edit : I forgot to mention that Im trying this in nwjs.

Update: Ok I understood that, it works well with nodejs, but for some reason, it doesn't work when using nwjs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    execIssues specific to the shell.exec() APIwontfix

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions