From 5990440d53c5b9125ba59ef75178d03c9aeb7cb8 Mon Sep 17 00:00:00 2001 From: Robert Martin-Legene <robert@nic.ar> Date: Fri, 24 May 2019 21:41:38 -0300 Subject: [PATCH] All this time I read request and require as the same module and did not understand why it did not work. --- bin/installbfa.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/installbfa.sh b/bin/installbfa.sh index 2637669..7f61f33 100755 --- a/bin/installbfa.sh +++ b/bin/installbfa.sh @@ -70,12 +70,18 @@ function web3install info "Initialising nodejs." && runasownerof ~bfa npm init -y # nodejs package(s) that we need. - info "Installing nodejs module: require" - runasownerof ~bfa npm install require - if echo 'require("web3")' | runasownerof ~bfa nodejs 2>/dev/null + if ! runasownerof ~bfa npm ls require + then + info "Installing nodejs module: require" + runasownerof ~bfa npm install require + fi + if ! runasownerof ~bfa npm ls request + then + info "Installing nodejs module: request" + runasownerof ~bfa npm install request + fi + if ! runasownerof ~bfa npm ls web3 then - true - else info "Installing nodejs module: web3 (will show many warnings)" runasownerof ~bfa npm install web3 fi -- GitLab