Ver código fonte

Specify npm version

Bob Mottram 7 anos atrás
pai
commit
cd143fdefc
2 arquivos alterados com 10 adições e 6 exclusões
  1. 9
    5
      src/freedombone-image-customise
  2. 1
    1
      src/freedombone-utils-nodejs

+ 9
- 5
src/freedombone-image-customise Ver arquivo

@@ -572,13 +572,17 @@ install_patchwork() {
572 572
         echo $'/usr/bin/node not found'
573 573
         exit 7235728
574 574
     fi
575
-    wget https://www.npmjs.com/install.sh -O $rootdir/root/npm_install.sh
576
-    if [ ! -f $rootdir/root/npm_install.sh ]; then
577
-        echo $'Unable to download npm installer'
578
-        exit 8793636
575
+    if [ -f /usr/share/npm/bin/npm-cli.js ]; then
576
+        ln -s /usr/share/npm/bin/npm-cli.js /usr/bin/npm
577
+    else
578
+        wget https://www.npmjs.com/install.sh -O $rootdir/root/npm_install.sh
579
+        if [ ! -f $rootdir/root/npm_install.sh ]; then
580
+            echo $'Unable to download npm installer'
581
+            exit 8793636
582
+        fi
579 583
     fi
580 584
     chroot "$rootdir" chmod +x /root/npm_install.sh
581
-    chroot "$rootdir" /root/npm_install.sh
585
+    chroot "$rootdir" /root/npm_install.sh $NPM_VERSION
582 586
 
583 587
     git clone https://github.com/ssbc/patchwork $rootdir/etc/patchwork
584 588
 

+ 1
- 1
src/freedombone-utils-nodejs Ver arquivo

@@ -35,7 +35,7 @@ VARIANTS='mesh'
35 35
 
36 36
 # change these versions at your peril. Things will often crash if you don't
37 37
 # have specifically the correct versions
38
-NODEJS_VERSION='6.10.1'
38
+NODEJS_VERSION='6.11.3'
39 39
 NODEJS_N_VERSION='2.1.7'
40 40
 NPM_VERSION='4.0.5'
41 41