From 35c80d99112c8c80a850bc9faf87fc636906265f Mon Sep 17 00:00:00 2001 From: Metis <100518708+sheepishgoat@users.noreply.github.com> Date: Sat, 19 Oct 2024 01:35:11 -0400 Subject: [PATCH] node --- tools/bootstrap/node_.ps1 | 11 ++++++++++- tools/ci/install_node.sh | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/bootstrap/node_.ps1 b/tools/bootstrap/node_.ps1 index ac8d3b343f..53dd65ae60 100644 --- a/tools/bootstrap/node_.ps1 +++ b/tools/bootstrap/node_.ps1 @@ -29,7 +29,16 @@ $Cache = "$BaseDir\.cache" if ($Env:TG_BOOTSTRAP_CACHE) { $Cache = $Env:TG_BOOTSTRAP_CACHE } -$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_PRECISE" +# 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 c21b8f0110..906984ed3f 100755 --- 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