From 335cb0d1d1a72ca016b9b6a7ad258dfeecef390d 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 e227e7853f5..dfbefa955ca 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -92,7 +92,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,