From 84ab52418fd5299128a3aeafd77f6116e86163b1 Mon Sep 17 00:00:00 2001 From: "P. Roebuck" Date: Wed, 12 Jun 2019 13:57:02 -0500 Subject: [PATCH] Update appveyor.yml Future-proof install of Node versions --- appveyor.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0527d3e13a..780466f46b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -35,9 +35,14 @@ install: ## Node-related installs - ps: Add-AppveyorMessage "Installing Node..." - set PATH=%APPDATA%\npm;C:\MinGW\bin;%PATH% - ## :NOTE: Use slower `Update-NodeJSInstallation` until pre-installed Node-12 image available - #- ps: Install-Product node $env:nodejs_version $env:platform - - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:platform + ## Prefer pre-installed Node versions, with fallback to manual update + - ps: | + try { + Install-Product node $env:nodejs_version $env:platform + } catch { + Add-AppveyorMessage " install failed - attempting manual update..." + Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:platform + } - ps: Add-AppveyorMessage "Installing npm..." - npm install -g npm ## Mocha-related package installs