Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(NODE-6636): set proper npm version on node install #573

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .evergreen/install-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
pushd $SCRIPT_DIR

NODE_LTS_VERSION=${NODE_LTS_VERSION:-20}
# npm version can be defined in the environment for cases where we need to install
# a version lower than latest to support EOL Node versions.
NPM_VERSION=${NPM_VERSION:-latest}
# If NODE_LTS_VERSION is numeric and less than 18, default to 9, if less than 20, default to 10.
# Do not override if it is already set.
if [[ "$NODE_LTS_VERSION" =~ ^[0-9]+$ && "$NODE_LTS_VERSION" -lt 18 ]]; then
NPM_VERSION=${NPM_VERSION:-9}
elif [[ "$NODE_LTS_VERSION" =~ ^[0-9]+$ && "$NODE_LTS_VERSION" -lt 20 ]]; then
NPM_VERSION=${NPM_VERSION:-10}
else
NPM_VERSION=${NPM_VERSION:-latest}
fi
export NPM_VERSION=${NPM_VERSION}

source "./init-node-and-npm-env.sh"

Expand Down
Loading