From c0133e403230ce7fbf814a0c4afa96d2a830754b Mon Sep 17 00:00:00 2001 From: Jeremiah <42397676+jlsnow301@users.noreply.github.com> Date: Sat, 11 May 2024 01:17:07 -0700 Subject: [PATCH] Reimplements node compatibility mode (#83141) ## About The Pull Request Puts a switch inside our build tools that will download the appropriate node version based on your OS. #82334 ## Why It's Good For The Game Closes #83076 Allows players to play the game --- dependencies.sh | 5 +++-- tools/bootstrap/node_.ps1 | 13 ++++++++++++- tools/ci/install_node.sh | 4 ++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dependencies.sh b/dependencies.sh index eb7d629d954ae..d5c22948358b6 100644 --- a/dependencies.sh +++ b/dependencies.sh @@ -11,8 +11,9 @@ export BYOND_MINOR=1637 export RUST_G_VERSION=3.1.0 #node version -export NODE_VERSION=20 -export NODE_VERSION_LTS=20.12.0 +export NODE_VERSION_LTS=20.13.0 +# compatiblility mode MUST work with windows 7 +export NODE_VERSION_COMPAT=20.2.0 # SpacemanDMM git tag export SPACEMAN_DMM_VERSION=suite-1.8 diff --git a/tools/bootstrap/node_.ps1 b/tools/bootstrap/node_.ps1 index 31cca39d14190..d4df216773b8c 100644 --- a/tools/bootstrap/node_.ps1 +++ b/tools/bootstrap/node_.ps1 @@ -31,7 +31,18 @@ if ($Env:TG_BOOTSTRAP_CACHE) { $Cache = $Env:TG_BOOTSTRAP_CACHE } -$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_LTS" +# Get OS version +$OSMajor = (Get-WmiObject -Class Win32_OperatingSystem).Version.Split(".")[0] + +# Set Node version based on OS version +if ($OSMajor -lt 10) { + # Anything under Windows 10 + $NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_COMPAT" +} +else { + $NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_LTS" +} + $NodeSource = "https://nodejs.org/download/release/v$NodeVersion/win-x64/node.exe" $NodeTargetDir = "$Cache\node-v$NodeVersion-x64" $NodeTarget = "$NodeTargetDir\node.exe" diff --git a/tools/ci/install_node.sh b/tools/ci/install_node.sh index c21b8f0110b0b..906984ed3fa10 100644 --- a/tools/ci/install_node.sh +++ b/tools/ci/install_node.sh @@ -5,6 +5,6 @@ source dependencies.sh if [[ -e ~/.nvm/nvm.sh ]]; then source ~/.nvm/nvm.sh - nvm install $NODE_VERSION - nvm use $NODE_VERSION + nvm install $NODE_VERSION_COMPAT + nvm use $NODE_VERSION_COMPAT fi