From 1f1198d6c2c6e7ad40778c2607e0dfd601b561ad Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Wed, 16 Feb 2022 22:23:43 +0530 Subject: [PATCH] lib: stop installing fetch if no_browser_globals is true MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/41816 Signed-off-by: Darshan Sen PR-URL: https://github.com/nodejs/node/pull/41969 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Nitzan Uziely Reviewed-By: Filip Skokan Reviewed-By: Mestery Reviewed-By: Michaƫl Zasso --- lib/internal/bootstrap/pre_execution.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index 1a4766e8ac9393..acee6ebdf90d23 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -147,7 +147,8 @@ function setupWarningHandler() { // https://fetch.spec.whatwg.org/ function setupFetch() { - if (!getOptionValue('--experimental-fetch')) { + if (process.config.variables.node_no_browser_globals || + !getOptionValue('--experimental-fetch')) { return; }