diff --git a/scripts/generate-dev-bundle.ps1 b/scripts/generate-dev-bundle.ps1 index 9d8d5e81d3..1d7f874e40 100644 --- a/scripts/generate-dev-bundle.ps1 +++ b/scripts/generate-dev-bundle.ps1 @@ -108,12 +108,21 @@ Function Add-Python { "$pythonExe" } +# Nodejs 14 official download source has been discontinued, we are switching to our custom source https://static.meteor.com Function Add-NodeAndNpm { if ("${NODE_VERSION}" -match "-rc\.\d+$") { $nodeUrlBase = 'https://nodejs.org/download/rc' } else { $nodeUrlBase = 'https://nodejs.org/dist' } +} + +Function Add-Node14AndNpm { + if ("${NODE_VERSION}" -match "-rc\.\d+$") { + $nodeUrlBase = 'https://nodejs.org/download/rc' + } else { + $nodeUrlBase = 'https://static.meteor.com/dev-bundle-node-os' + } $nodeArchitecture = 'win-x64' @@ -341,7 +350,7 @@ $env:npm_config_cache = "$dirNpmCache" $env:PATH = "$env:PATH;$dirBin" # Install Node.js and npm and get their paths to use from here on. -$toolCmds = Add-NodeAndNpm +$toolCmds = Add-Node14AndNpm "Location of node.exe:" & Get-Command node | Select-Object -ExpandProperty Definition diff --git a/scripts/generate-dev-bundle.sh b/scripts/generate-dev-bundle.sh index 0db482d7f9..671648d73e 100755 --- a/scripts/generate-dev-bundle.sh +++ b/scripts/generate-dev-bundle.sh @@ -36,6 +36,13 @@ downloadNodeFromS3() { curl "${NODE_URL}" | tar zx --strip 1 } +# Nodejs 14 official download source has been discontinued, we are switching to our custom source https://static.meteor.com +downloadOfficialNode14() { + METEOR_NODE_URL="https://static.meteor.com/dev-bundle-node-os/v${NODE_VERSION}/${NODE_TGZ}" + echo "Downloading Node from ${METEOR_NODE_URL}" >&2 + curl "${METEOR_NODE_URL}" | tar zx --strip-components 1 +} + downloadOfficialNode() { NODE_URL="https://nodejs.org/dist/v${NODE_VERSION}/${NODE_TGZ}" echo "Downloading Node from ${NODE_URL}" >&2 @@ -50,7 +57,7 @@ downloadReleaseCandidateNode() { # Try each strategy in the following order: extractNodeFromTarGz || downloadNodeFromS3 || \ - downloadOfficialNode || downloadReleaseCandidateNode + downloadOfficialNode14 || downloadReleaseCandidateNode # On macOS, download MongoDB from mongodb.com. On Linux, download a custom build # that is compatible with current distributions. If a 32-bit Linux is used,