lib: stop installing fetch if no_browser_globals is true

Fixes: https://github.com/nodejs/node/issues/41816
Signed-off-by: Darshan Sen <raisinten@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/41969
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
Darshan Sen authored and GitHub committed 2022-02-16 16:53:43 +00:00
1 parent 34cf563add
commit a82c1a1da7
1 file changed
+2 -1
+2 -1
View File
@@ -151,7 +151,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;
}