Skip to content

Commit

Permalink
add check for node when using global fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Jan 20, 2023
1 parent ce11d92 commit 01b535d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import rc from "rc";
import ru from "registry-auth-token/registry-url.js";
import semver from "semver";
import textTable from "text-table";
import {cwd, stdout, argv, env, exit} from "node:process";
import {cwd, stdout, argv, env, exit, versions} from "node:process";
import hostedGitInfo from "hosted-git-info";
import {join, dirname} from "node:path";
import {lstatSync, readFileSync, truncateSync, writeFileSync, accessSync} from "node:fs";
Expand All @@ -19,7 +19,7 @@ import {timerel} from "timerel";
const {fromUrl} = hostedGitInfo;

let fetch;
if (globalThis.Deno && globalThis.fetch) {
if (globalThis.fetch && !versions?.node) { // avoid node experimental warning
fetch = globalThis.fetch;
} else {
fetch = fetchEnhanced(nodeFetch, {undici: false});
Expand Down

0 comments on commit 01b535d

Please # to comment.