From 2c2a2ca0f2f80017614e456c38b97fa269188c7b Mon Sep 17 00:00:00 2001 From: Alan Greene Date: Wed, 30 Aug 2023 16:15:52 +0100 Subject: [PATCH] Fail early if nvm fails to install Node.js binary 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. --- test/presubmit-tests.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/presubmit-tests.sh b/test/presubmit-tests.sh index dc55ab339..d450b2395 100755 --- a/test/presubmit-tests.sh +++ b/test/presubmit-tests.sh @@ -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() {