Skip to content

Commit 5f33b32

Browse files
[Linux] Rework NodeJS install (#4378)
1 parent 2349199 commit 5f33b32

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

images/linux/scripts/installers/nodejs.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
# Source the helpers for use with the script
88
source $HELPER_SCRIPTS/install.sh
99

10-
# Install LTS Node.js and related build tools
10+
# Install default Node.js
11+
defaultVersion=$(get_toolset_value '.node.default')
12+
# TODO: Usage of "githubusercontent.com/mklement0" doesn't look like a correct approach. Need to correct it according to the official Node.js docs.
1113
curl -sL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s -- -ny -
12-
~/n/bin/n lts
14+
~/n/bin/n $defaultVersion
15+
1316
# Install node modules
1417
node_modules=$(get_toolset_value '.node_modules[].name')
1518

images/linux/scripts/tests/Node.Tests.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@ Describe "Node.js" {
1010

1111
"$NodeCommand --version" | Should -ReturnZeroExitCode
1212
}
13+
14+
It "Node.js version should correspond to the version in the toolset" {
15+
node --version | Should -BeLike "v$((Get-ToolsetContent).node.default).*"
16+
}
1317
}
1418

images/linux/toolsets/toolset-1804.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@
283283
"binary_name": "selenium-server-standalone"
284284
},
285285
"rubygems": [],
286+
"node": {
287+
"default": "14"
288+
},
286289
"node_modules": [
287290
{
288291
"name": "grunt",

images/linux/toolsets/toolset-2004.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@
283283
"version": "3",
284284
"binary_name": "selenium-server-standalone"
285285
},
286+
"node": {
287+
"default": "14"
288+
},
286289
"node_modules": [
287290
{
288291
"name": "grunt",

0 commit comments

Comments
 (0)