Skip to content

Commit

Permalink
Add support for installing Node.js on macOS (#38903) (#38910)
Browse files Browse the repository at this point in the history
This commit adds two new functions in
`install_macos_tools.sh` that install nodejs
and common nodejs dependencies.

(cherry picked from commit 8f86989)

Co-authored-by: Dimitrios Liappis <[email protected]>
  • Loading branch information
mergify[bot] and dliappis authored Apr 12, 2024
1 parent 73e9000 commit edcdae8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .buildkite/scripts/install_macos_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,28 @@ config_git() {
fi
}

withNodeJSEnv() {
local version=$1
echo "~~~ Installing nvm and Node.js"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
echo "Installing Node.js version: $version"
nvm install "$version"
# export PATH="${nvmPath}:${PATH}"
nvm use "$version"
node --version
echo "~~~ Resuming commands"
}

installNodeJsDependencies() {
echo "~~~ Installing Node.js packages"
# needed for beats-xpack-heartbeat
echo "Install @elastic/synthetics"
npm i -g @elastic/synthetics
echo "~~~ Resuming commands"
}

add_bin_path
with_go "${GO_VERSION}"
with_mage
Expand Down

0 comments on commit edcdae8

Please sign in to comment.