Skip to content

Should overwriting child_process.execFile result in changed behaviour of child_process.exec? #15076

Closed
@Ginden

Description

@Ginden
node -e "child_process.execFile = null; child_process.exec('cat package.json')"
    child_process.js:138
      return exports.execFile(opts.file,
    TypeError: exports.execFile is not a function
        at Object.exports.exec (child_process.js:138:18)

I couldn't find in documentation why child_process behave this way (but it behaves like that for at least four years).

Relevant line https://github.com/nodejs/node/blob/58831b2/lib/child_process.js#L136

Metadata

Metadata

Assignees

No one assigned

    Labels

    child_processIssues and PRs related to the child_process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions