Skip to content

Commit

Permalink
fixup: stick to Node.js 20.11.1 for building internal Node.js 20 in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Mar 27, 2024
1 parent e6a72b0 commit 51866c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .evergreen/install-node.sh
Expand Up @@ -45,13 +45,20 @@ else
# needs to be built from source
if [[ "${DISTRO_ID}" =~ ^(amazon2-|rhel7|ubuntu18|suse12) ]] && [[ "$NODE_JS_VERSION" =~ ^20 ]];
then
bash "$BASEDIR/install-node-source.sh"
NODE_JS_SOURCE_VERSION="$NODE_JS_VERSION"
if echo $NODE_JS_VERSION | grep -q ^20 ; then
# Node.js 20.11.1 is the last 20.x that builds out of the box on RHEL7
# https://github.com/nodejs/node/issues/52223
NODE_JS_SOURCE_VERSION=20.11.1
fi
env NODE_JS_VERSION="$NODE_JS_SOURCE_VERSION" bash "$BASEDIR/install-node-source.sh"
nvm use $NODE_JS_SOURCE_VERSION
else
echo nvm install --no-progress $NODE_JS_VERSION && nvm alias default $NODE_JS_VERSION
nvm install --no-progress $NODE_JS_VERSION
nvm alias default $NODE_JS_VERSION
nvm use $NODE_JS_VERSION
fi
nvm use $NODE_JS_VERSION
set -x

if env PATH="/opt/chefdk/gitbin:$PATH" git --version | grep -q 'git version 1.'; then
Expand Down
4 changes: 2 additions & 2 deletions .evergreen/setup-env.sh
Expand Up @@ -13,8 +13,8 @@ if [ "$OS" != "Windows_NT" ]; then
echo "Setting NVM environment home: $NVM_DIR"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
set +x # nvm is very verbose
echo nvm use $NODE_JS_VERSION
nvm use $NODE_JS_VERSION
echo nvm use $NODE_JS_VERSION || nvm use 20.11.1
nvm use $NODE_JS_VERSION || nvm use 20.11.1 # see install-node.sh
set -x
export PATH="$NVM_BIN:$PATH"

Expand Down

0 comments on commit 51866c7

Please sign in to comment.