Skip to content

Commit

Permalink
Fail early if nvm fails to install Node.js binary
Browse files Browse the repository at this point in the history
Instead of trying to build Node.js from source, fail early when
nvm fails to install using the Node.js binary.

This avoids jobs that take >1h to provide feedback rather than
the usual few minutes in case of error at the install stage.
  • Loading branch information
AlanGreene authored and tekton-robot committed Aug 30, 2023
1 parent 5a058c0 commit 2c2a2ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ function get_node() {
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
nvm install
# if nvm install fails using the Node.js binary, the `-b` causes it to exit
# instead of trying to build from source
nvm install -b
}

function node_npm_install() {
Expand Down

0 comments on commit 2c2a2ca

Please sign in to comment.