From 74c98562c4708690f86d73b0f44fa6dad88fff2f Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Fri, 8 Nov 2024 22:53:56 +0100 Subject: [PATCH] Only remove npm.ps1 if it exists --- .evergreen/InstallNode.ps1 | 2 +- .evergreen/install-node.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.evergreen/InstallNode.ps1 b/.evergreen/InstallNode.ps1 index 092d60a7f..35016fa51 100644 --- a/.evergreen/InstallNode.ps1 +++ b/.evergreen/InstallNode.ps1 @@ -20,7 +20,7 @@ Get-ChildItem -Path $PSScriptRoot Set-Location -Path $node_dir Remove-Item .\npm Remove-Item .\npm.cmd -Remove-Item .\npm.ps1 +if (Test-Item .\npm.ps1) { Remove-Item .\npm.ps1 } Remove-Item .\npx Remove-Item .\npx.cmd Move-Item .\node_modules\npm -Destination .\node_modules\npm2 diff --git a/.evergreen/install-node.sh b/.evergreen/install-node.sh index 12d2b6046..d707a44f8 100755 --- a/.evergreen/install-node.sh +++ b/.evergreen/install-node.sh @@ -2,7 +2,11 @@ set -e set -x export BASEDIR="$PWD/.evergreen" -NPM_VERSION=10.8.3 # 10.9.0 does not install well on Windows +if echo $NODE_JS_VERSION | grep -q ^20 ; then + NPM_VERSION=10.8.3 # 10.9.0 does not install well on Windows +else + NPM_VERSION=10.9.0 +fi if [ "$OS" == "Windows_NT" ]; then powershell "$(cygpath -w "$BASEDIR")"/InstallNode.ps1