aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2017-05-30 16:35:34 -0700
committerGravatar murgatroid99 <mlumish@google.com>2017-05-30 16:35:34 -0700
commitd2f91e8f024bcfb55675d426e654a9d02ac066e7 (patch)
treeb842cfd6a759e2a3166490af17a5a95d702c8d93
parent1ef9f4ed4da81222d7ddc26bc5fa5c5ca9ad86c0 (diff)
Fix npm cache handling when updating dependencies
-rw-r--r--tools/run_tests/helper_scripts/pre_build_node.bat6
-rwxr-xr-xtools/run_tests/helper_scripts/pre_build_node.sh6
2 files changed, 8 insertions, 4 deletions
diff --git a/tools/run_tests/helper_scripts/pre_build_node.bat b/tools/run_tests/helper_scripts/pre_build_node.bat
index addb01a2a4..62b883de46 100644
--- a/tools/run_tests/helper_scripts/pre_build_node.bat
+++ b/tools/run_tests/helper_scripts/pre_build_node.bat
@@ -29,5 +29,7 @@
set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
-@rem Expire cache after 1 day
-call npm update --cache-min 86400
+@rem Update npm to at least version 5
+call npm update -g npm
+
+call npm update --prefer-online
diff --git a/tools/run_tests/helper_scripts/pre_build_node.sh b/tools/run_tests/helper_scripts/pre_build_node.sh
index 083cb2bc77..b7c6e14e74 100755
--- a/tools/run_tests/helper_scripts/pre_build_node.sh
+++ b/tools/run_tests/helper_scripts/pre_build_node.sh
@@ -35,10 +35,12 @@ source ~/.nvm/nvm.sh
nvm install $NODE_VERSION
set -ex
+# Update npm to at least version 5
+npm update -g npm
+
export GRPC_CONFIG=${CONFIG:-opt}
-# Expire cache after 1 day
-npm update --cache-min 86400
+npm update --prefer-online
npm install node-gyp-install
./node_modules/.bin/node-gyp-install