Skip to content

Commit 79ff955

Browse files
authored
test(NODE-5603): use npm 9 on eol node versions (#618)
1 parent 7b98403 commit 79ff955

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.evergreen/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ tasks:
111111
vars:
112112
NODE_LTS_VERSION: 16
113113
- func: install dependencies
114+
vars:
115+
NPM_VERSION: 9
114116
- func: run tests
115117
vars:
116118
TEST_TARGET: node
@@ -213,8 +215,11 @@ tasks:
213215
commands:
214216
- func: fetch source
215217
vars:
218+
# This needs to stay pinned at Node v18.16.0 for consistency across perf runs.
216219
NODE_LTS_VERSION: v18.16.0
217220
- func: install dependencies
221+
vars:
222+
NPM_VERSION: 9
218223
- func: run benchmarks
219224
vars:
220225
WEB: false

.evergreen/install-dependencies.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
set -o errexit # Exit the script with error if any of the commands fail
33

44
NODE_LTS_VERSION=${NODE_LTS_VERSION:-16}
5+
# npm version can be defined in the environment for cases where we need to install
6+
# a version lower than latest to support EOL Node versions.
7+
NPM_VERSION=${NPM_VERSION:-latest}
58

69
source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh"
710

@@ -95,8 +98,7 @@ else
9598
fi
9699

97100
if [[ $operating_system != "win" ]]; then
98-
# Update npm to latest when we can
99-
npm install --global npm@latest
101+
npm install --global npm@$NPM_VERSION
100102
hash -r
101103
fi
102104

0 commit comments

Comments
 (0)