From 968c03e6e5e0023d96bf521bcfad68cdaee9966d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 2 Oct 2019 06:37:20 -0700 Subject: [PATCH 1/2] Make execa compatible with Node.js 13.0.0-pre Use `error.code` instead of `error.errno` when expecting a string error code. `errno` is always numeric in Node.js 13.0.0-pre. Node.js 13.0.0 comes out later this month (October 2019) so implementing and publishing this change will hopefully smooth the upgrade path for execa users. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 70466bb285..0de3369f7b 100644 --- a/index.js +++ b/index.js @@ -190,7 +190,7 @@ module.exports.sync = (file, args, options) => { code: result.status, command, parsed, - timedOut: result.error && result.error.errno === 'ETIMEDOUT', + timedOut: result.error && result.error.code === 'ETIMEDOUT', isCanceled: false, killed: result.signal !== null }); From ca3edf2d78c2fcb953b4d29e631e2ee2dbb5aa2e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 2 Oct 2019 12:25:29 -0700 Subject: [PATCH 2/2] Update readme example output for Node.js 13.0.0 `errno` property will be numeric in Node.js 13.0.0, so update the readme accordingly. --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index fb9316cebd..6b42383fc1 100644 --- a/readme.md +++ b/readme.md @@ -59,7 +59,7 @@ const execa = require('execa'); /* { message: 'Command failed with exit code 2 (ENOENT): wrong command spawn wrong ENOENT', - errno: 'ENOENT', + errno: -2, syscall: 'spawn wrong', path: 'wrong', spawnargs: ['command'], @@ -98,7 +98,7 @@ try { /* { message: 'Command failed with exit code 2 (ENOENT): wrong command spawnSync wrong ENOENT', - errno: 'ENOENT', + errno: -2, syscall: 'spawnSync wrong', path: 'wrong', spawnargs: ['command'],