From a2f3fde6520a3108219aaacf326d866c21872640 Mon Sep 17 00:00:00 2001
From: Dan Scott <dscott@laurentian.ca>
Date: Wed, 12 Apr 2017 23:28:57 -0400
Subject: [PATCH] Ancient version of npm installed with nodejs 0.10 was bad

Tests failed because npm 1.x was not installing the child dependencies that
were listed in the package.json files that we had identified as direct
dependencies of our package.

One option would be to run "npm install -g npm" to update npm to a more
modern version, but that also warned that nodejs 0.10.x was way too old.
So let's install a nodejs binary and be done with it.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
---
 installer/wheezy/eg_wheezy_installer.sh | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/installer/wheezy/eg_wheezy_installer.sh b/installer/wheezy/eg_wheezy_installer.sh
index 693ad1212..99cffd606 100755
--- a/installer/wheezy/eg_wheezy_installer.sh
+++ b/installer/wheezy/eg_wheezy_installer.sh
@@ -106,9 +106,11 @@ function init_variables {
     echo EVERGREEN_PREREQ_TARGET=${EVERGREEN_PREREQ_TARGET}
     echo EVERGREEN_DB_PREREQ_TARGET=${EVERGREEN_DB_PREREQ_TARGET}
 
-    export NODEJS_REPO='https://github.com/joyent/node.git'
-    export NODEJS_VERSION='v0.10.35'
-    echo "NODEJS_REPO=$NODEJS_REPO"
+    export NODEJS_VERSION='v6.10.1'
+    export NODEJS_BINDIR="node-$NODEJS_VERSION-linux-x64"
+    export NODEJS_TARBIN="$NODEJS_BINDIR.tar.xz"
+    export NODEJS_BINARY="https://nodejs.org/dist/$NODEJS_VERSION/$NODEJS_TARBIN"
+    echo "NODEJS_BINARY=$NODEJS_BINARY"
     echo "NODEJS_VERSION=$NODEJS_VERSION"
 
     echo End of intializing installer =~-._
@@ -371,11 +373,11 @@ function test_evergreen_build {
 # Run it as a standalone operation for now.
 function test_and_build_eg_browser_client {
     echo _.-~= Running Evergreen browser client build/test
-    cd /tmp
-    git clone $NODEJS_REPO
-    cd node
-    git checkout -b $NODEJS_VERSION $NODEJS_VERSION
-    ./configure && make -j2 && make install
+    cd /home/opensrf
+    wget -N $NODEJS_BINARY
+    tar xf $NODEJS_TARBIN
+    echo Return Value = $?
+    export PATH=$PATH:/home/opensrf/$NODEJS_TARBIN/bin
     echo Return Value = $?
     npm update
     echo Return Value = $?
-- 
2.11.0