Browse Source

Remove nodejs install if it exists

Bob Mottram 8 years ago
parent
commit
2d2e7360c0
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      src/freedombone-utils-nodejs

+ 8
- 0
src/freedombone-utils-nodejs View File

149
     echo "deb-src https://deb.nodesource.com/node_6.x jessie main" >> /etc/apt/sources.list.d/nodesource.list
149
     echo "deb-src https://deb.nodesource.com/node_6.x jessie main" >> /etc/apt/sources.list.d/nodesource.list
150
 
150
 
151
     apt-get update
151
     apt-get update
152
+
153
+    if [ -f /usr/bin/nodejs ]; then
154
+        apt-get -yq remove --purge nodejs
155
+    fi
156
+    if [ -d /usr/local/lib/node_modules ]; then
157
+        rm -rf /usr/local/lib/node_modules
158
+    fi
159
+
152
     apt-get -yq install nodejs curl
160
     apt-get -yq install nodejs curl
153
 
161
 
154
     if [ ! -f /usr/bin/nodejs ]; then
162
     if [ ! -f /usr/bin/nodejs ]; then