From c4e5f013597bfc06c7e9050b6f090b45eb5fec5c Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Mon, 4 Dec 2017 11:37:31 +0000
Subject: [PATCH] Second install of npm

---
 src/freedombone-utils-nodejs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs
index 1c1b484d2..c5d94db29 100755
--- a/src/freedombone-utils-nodejs
+++ b/src/freedombone-utils-nodejs
@@ -128,6 +128,13 @@ function mesh_install_nodejs {
     $mesh_install_nodejs_prefix n --arch $N_ARCH ${NODEJS_VERSION}
     cp $rootdir/root/npm $rootdir/usr/bin/npm
 
+    # deliberate second install of npm
+    $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g npm@${NPM_VERSION} --save
+    if [ -f $rootdir/usr/local/bin/npm ]; then
+        cp $rootdir/usr/local/bin/npm /usr/bin/npm
+    fi
+    cp $rootdir/usr/bin/npm $rootdir/root/npm
+
     # check the version numbers
     cat <<EOF > $rootdir/usr/bin/test_nodejs_install
 #!/bin/bash
-- 
GitLab