Skip to content

Commit 2c781e9

Browse files
committed
fix: benchmarks node version
1 parent a6c647a commit 2c781e9

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
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 & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +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 10 does not work with Node < 18 so npm 9 will be installed on those versions.
6-
NODE_LOWEST_LTS=18
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}
78

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

@@ -97,12 +98,7 @@ else
9798
fi
9899

99100
if [[ $operating_system != "win" ]]; then
100-
# Update npm to latest when we can
101-
if [[ $NODE_LTS_VERSION -lt $NODE_LOWEST_LTS ]]; then
102-
npm install --global npm@9
103-
else
104-
npm install --global npm@latest
105-
fi
101+
npm install --global npm@$NPM_VERSION
106102
hash -r
107103
fi
108104

0 commit comments

Comments
 (0)