Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Labels
child_process Issues and PRs related to the child_process subsystem.

Comments

@Ginden
Copy link

Ginden commented Aug 29, 2017

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

@Ginden Ginden changed the title Why overwriting child_process.execFile will result in changed behaviour of child_process.exec Should overwriting child_process.execFile result in changed behaviour of child_process.exec? Aug 29, 2017
@mscdex mscdex added the child_process Issues and PRs related to the child_process subsystem. label Aug 29, 2017
@bnoordhuis
Copy link
Member

I don't think we consider this a bug; I'll interpret the fact that this issue didn't generate discussion as tacit approval of that. If you monkey-patch node.js itself, unexpected things may happen.

I'll close this out, reopen if that is a mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment