diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 3c8a314bf04644..20ad9754ca7a7e 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -33,6 +33,7 @@ const { isUint8Array } = require('internal/util/types'); const spawn_sync = process.binding('spawn_sync'); const { + UV_EACCES, UV_EAGAIN, UV_EINVAL, UV_EMFILE, @@ -315,7 +316,8 @@ ChildProcess.prototype.spawn = function(options) { var err = this._handle.spawn(options); // Run-time errors should emit an error, not throw an exception. - if (err === UV_EAGAIN || + if (err === UV_EACCES || + err === UV_EAGAIN || err === UV_EMFILE || err === UV_ENFILE || err === UV_ENOENT) {