浏览代码

More npm copying

Bob Mottram 7 年前
父节点
当前提交
0ed95a0691
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5
    4
      src/freedombone-utils-nodejs

+ 5
- 4
src/freedombone-utils-nodejs 查看文件

@@ -164,19 +164,20 @@ function mesh_install_nodejs {
164 164
     nodejs_setup_global_modules
165 165
     nodejs_fix_cpu_detection
166 166
     $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g npm@${NPM_VERSION} --save
167
+    if [ -f "$rootdir/.npm-global/bin/npm" ]; then
168
+        cp "$rootdir/.npm-global/bin/npm" "$rootdir/usr/local/bin/npm"
169
+        cp "$rootdir/.npm-global/bin/npm" "$rootdir/usr/bin/npm"
170
+    fi
167 171
     if [ -f "$rootdir/usr/local/bin/npm" ]; then
168 172
         cp "$rootdir/usr/local/bin/npm" "$rootdir/usr/bin/npm"
169 173
     fi
170 174
     cp "$rootdir/usr/bin/npm" "$rootdir/root/npm"
171 175
 
172
-    # deliberately called again
173
-    nodejs_fix_cpu_detection
174
-
175 176
     # update from the old debian nodejs version
176 177
     $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g n@${NODEJS_N_VERSION} --save
177 178
     $mesh_install_nodejs_prefix n --arch $N_ARCH ${NODEJS_VERSION}
178 179
     cp "$rootdir/root/npm" "$rootdir/usr/bin/npm"
179
-
180
+    cp "$rootdir/root/npm" "$rootdir/usr/local/bin/npm"
180 181
 
181 182
     # deliberate second install of npm
182 183
     $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g npm@${NPM_VERSION} --save