mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 20:56:47 +00:00
[Linux] Rework NodeJS install (#4378)
This commit is contained in:
@@ -7,9 +7,12 @@
|
|||||||
# Source the helpers for use with the script
|
# Source the helpers for use with the script
|
||||||
source $HELPER_SCRIPTS/install.sh
|
source $HELPER_SCRIPTS/install.sh
|
||||||
|
|
||||||
# Install LTS Node.js and related build tools
|
# Install default Node.js
|
||||||
|
defaultVersion=$(get_toolset_value '.node.default')
|
||||||
|
# TODO: Usage of "githubusercontent.com/mklement0" doesn't look like a correct approach. Need to correct it according to the official Node.js docs.
|
||||||
curl -sL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s -- -ny -
|
curl -sL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s -- -ny -
|
||||||
~/n/bin/n lts
|
~/n/bin/n $defaultVersion
|
||||||
|
|
||||||
# Install node modules
|
# Install node modules
|
||||||
node_modules=$(get_toolset_value '.node_modules[].name')
|
node_modules=$(get_toolset_value '.node_modules[].name')
|
||||||
|
|
||||||
|
|||||||
@@ -10,5 +10,9 @@ Describe "Node.js" {
|
|||||||
|
|
||||||
"$NodeCommand --version" | Should -ReturnZeroExitCode
|
"$NodeCommand --version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
It "Node.js version should correspond to the version in the toolset" {
|
||||||
|
node --version | Should -BeLike "v$((Get-ToolsetContent).node.default).*"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -283,6 +283,9 @@
|
|||||||
"binary_name": "selenium-server-standalone"
|
"binary_name": "selenium-server-standalone"
|
||||||
},
|
},
|
||||||
"rubygems": [],
|
"rubygems": [],
|
||||||
|
"node": {
|
||||||
|
"default": "14"
|
||||||
|
},
|
||||||
"node_modules": [
|
"node_modules": [
|
||||||
{
|
{
|
||||||
"name": "grunt",
|
"name": "grunt",
|
||||||
|
|||||||
@@ -283,6 +283,9 @@
|
|||||||
"version": "3",
|
"version": "3",
|
||||||
"binary_name": "selenium-server-standalone"
|
"binary_name": "selenium-server-standalone"
|
||||||
},
|
},
|
||||||
|
"node": {
|
||||||
|
"default": "14"
|
||||||
|
},
|
||||||
"node_modules": [
|
"node_modules": [
|
||||||
{
|
{
|
||||||
"name": "grunt",
|
"name": "grunt",
|
||||||
|
|||||||
Reference in New Issue
Block a user