瀏覽代碼

Remove nodejs install if it exists

Bob Mottram 8 年之前
父節點
當前提交
2d2e7360c0
共有 1 個檔案被更改,包括 8 行新增0 行删除
  1. 8
    0
      src/freedombone-utils-nodejs

+ 8
- 0
src/freedombone-utils-nodejs 查看文件

@@ -149,6 +149,14 @@ function install_nodejs {
149 149
     echo "deb-src https://deb.nodesource.com/node_6.x jessie main" >> /etc/apt/sources.list.d/nodesource.list
150 150
 
151 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 160
     apt-get -yq install nodejs curl
153 161
 
154 162
     if [ ! -f /usr/bin/nodejs ]; then