From abbe7915f5f0e8405c74c6687582d8b64de1e4ea Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Mon, 24 Sep 2018 20:26:24 +0100
Subject: [PATCH] Try reverting to previous npm

---
 src/freedombone-image-customise | 3 +++
 src/freedombone-utils-nodejs    | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise
index 1660abcf2..d88b246b0 100755
--- a/src/freedombone-image-customise
+++ b/src/freedombone-image-customise
@@ -637,6 +637,8 @@ install_patchwork() {
 export PATH=/root/.npm-global/bin:$PATH
 export NPM_CONFIG_PREFIX=/root/.npm-global
 
+npm install --arch=$NPM_ARCH -g npm@4
+
 cd /etc/patchwork
 npm install --arch=$NPM_ARCH --build-from-source
 npm install --arch=$NPM_ARCH --save-dev electron-rebuild
@@ -644,6 +646,7 @@ if ! ./node_modules/.bin/electron-rebuild; then
     exit 1
 fi
 npm install --arch=$NPM_ARCH git-ssb
+npm install --arch=$NPM_ARCH -g npm@${NPM_VERSION} --save
 EOF
     chroot "$rootdir" /bin/chmod +x /usr/bin/install_patchwork
     chroot "$rootdir" /usr/bin/install_patchwork
diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs
index 185fb54b4..4fb3171f8 100755
--- a/src/freedombone-utils-nodejs
+++ b/src/freedombone-utils-nodejs
@@ -178,6 +178,7 @@ function mesh_install_nodejs {
         cp "$rootdir/usr/local/bin/npm" "$rootdir/usr/bin/npm"
     fi
     cp "$rootdir/usr/bin/npm" "$rootdir/root/npm"
+    $mesh_install_nodejs_prefix ln -s /root/.npm-global/lib/node_modules /usr/local/bin/node_modules
 
     # update from the old debian nodejs version
     $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g n@${NODEJS_N_VERSION} --save
-- 
GitLab