From 4692e284e305e3ec2418f7f5005bed8d3e62ad11 Mon Sep 17 00:00:00 2001 From: Gireesh Punathil Date: Sun, 26 Jul 2020 09:51:51 -0400 Subject: [PATCH] lib: absorb `path` error cases Absorb low level libuv failure in the process initialization phase Fixes: https://github.com/nodejs/node/issues/33759 Refs: https://github.com/nodejs/node/issues/33759#issuecomment-663980558 PR-URL: https://github.com/nodejs/node/pull/34519 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Zeyu Yang Reviewed-By: Harshitha K P --- lib/internal/bootstrap/pre_execution.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index 7e24bd16425b16..dd806022cada39 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -98,7 +98,9 @@ function patchProcessObject(expandArgv1) { if (expandArgv1 && process.argv[1] && !process.argv[1].startsWith('-')) { // Expand process.argv[1] into a full path. const path = require('path'); - process.argv[1] = path.resolve(process.argv[1]); + try { + process.argv[1] = path.resolve(process.argv[1]); + } catch {} } // TODO(joyeecheung): most of these should be deprecated and removed,