Skip to content

exec returning null from command #724

@webOS101

Description

@webOS101

Node version (or tell us if you're using electron or some other framework):

v6.2.1

ShellJS version (the most recent version/Github branch you see the bug on):

0.7.7

Operating system:

MacOS X 10.10

Description of the bug:

Occasionally, the exec command returns null instead of something valid. I have an automated build script that executes. Some time during the execution of the script, it fails with the error:

.../scripts/DocParser.js:51
		if (output.code === 0) {
		          ^

TypeError: Cannot read property 'code' of null

Example ShellJS command to reproduce the error:

const output = shelljs.exec(cmd, {silent: true});

These execs are called in a loop and it's not the first one that fails. If I call the script outside of the automation procedure, it runs to completion without issue. I'm super stumped on this one and could use any help debugging the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    execIssues specific to the shell.exec() API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions