Merge pull request #12582 from meteor/change-node-esm

Using Node 14 from ESM
This commit is contained in:
Gabriel Grubba
2023-04-03 18:22:11 -03:00
committed by GitHub
2 changed files with 18 additions and 2 deletions

View File

@@ -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

View File

@@ -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,