瀏覽代碼

Set n architecture

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

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

@@ -44,12 +44,15 @@ NPM_VERSION='4.0.5'
44 44
 NODEJS_INSTALLED_APPS_FILE=$HOME/.nodejs-apps
45 45
 
46 46
 function get_npm_arch {
47
+    N_ARCH='x86'
47 48
     NPM_ARCH='ia32'
48 49
     if [[ $ARCHITECTURE == 'arm'* ]]; then
49 50
         NPM_ARCH='armv7l'
51
+        N_ARCH='arm'
50 52
     fi
51 53
     if [[ $ARCHITECTURE == 'x86_64' || $ARCHITECTURE == 'amd64' ]]; then
52 54
         NPM_ARCH='x64'
55
+        N_ARCH='x64'
53 56
     fi
54 57
 }
55 58
 
@@ -90,7 +93,8 @@ function mesh_install_nodejs {
90 93
 
91 94
     # update from the old debian nodejs version
92 95
     get_npm_arch
93
-    chroot "$rootdir" npm install --arch=$NPM_ARCH node@$NODEJS_VERSION -g
96
+    chroot "$rootdir" npm install --arch=$NPM_ARCH -g n@${NODEJS_N_VERSION} --save
97
+    chroot "$rootdir" n --arch $N_ARCH ${NODEJS_VERSION}
94 98
 }
95 99
 
96 100
 function remove_nodejs {