From ff52a2f214ae72ff7fa69ea0ec094f33a598311c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 4 Jun 2017 14:56:49 +0100 Subject: [PATCH] Remove old npm directory --- src/freedombone-utils-nodejs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs index ad9ca79d..144b0022 100755 --- a/src/freedombone-utils-nodejs +++ b/src/freedombone-utils-nodejs @@ -176,6 +176,12 @@ function install_nodejs { npm install -g minimatch@3.0.3 --save # second npm install attempt seems necessary + if [ -f /usr/local/lib/node_modules/npm ]; then + rm -rf /usr/local/lib/node_modules/npm + fi + if [ -d /usr/local/lib/node_modules/npm ]; then + rm -rf /usr/local/lib/node_modules/npm + fi npm install -g npm@${NPM_VERSION} --save cp /usr/local/bin/npm /usr/bin/npm