mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-10 17:10:45 +01:00
Change net workaround for node 20
This commit is contained in:
parent
70071312d3
commit
d17ac770e6
@ -94,8 +94,13 @@ function createDefaultFiles() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const net = require("net");
|
const net = require("net");
|
||||||
// @ts-ignore work around a node v20 bug: https://github.com/nodejs/node/issues/47822#issuecomment-1564708870
|
// Work around a node v20.0.0, v20.1.0, and v20.2.0 bug. The issue was fixed in v20.3.0.
|
||||||
if (net.setDefaultAutoSelectFamily) net.setDefaultAutoSelectFamily(false);
|
// https://github.com/nodejs/node/issues/47822#issuecomment-1564708870
|
||||||
|
// Safe to remove once support for Node v20 is dropped.
|
||||||
|
if (process.versions && process.versions.node && process.versions.node.match(/20\.[0-2]\.0/)) {
|
||||||
|
// @ts-ignore
|
||||||
|
if (net.setDefaultAutoSelectFamily) net.setDefaultAutoSelectFamily(false);
|
||||||
|
}
|
||||||
|
|
||||||
const cliArguments = yargs(hideBin(process.argv))
|
const cliArguments = yargs(hideBin(process.argv))
|
||||||
.option('disableCsrf', {
|
.option('disableCsrf', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user