Explorar el Código

Fix for failing cpu detection during build

Bob Mottram hace 7 años
padre
commit
9dc754bc96
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5
    1
      src/freedombone-utils-nodejs

+ 5
- 1
src/freedombone-utils-nodejs Ver fichero

37
 # have specifically the correct versions
37
 # have specifically the correct versions
38
 NODEJS_VERSION='8.11.1'
38
 NODEJS_VERSION='8.11.1'
39
 NODEJS_N_VERSION='2.1.7'
39
 NODEJS_N_VERSION='2.1.7'
40
-NPM_VERSION='5.8.0'
40
+NPM_VERSION='5.6.0'
41
 
41
 
42
 # This file keeps track of the apps needing nodejs
42
 # This file keeps track of the apps needing nodejs
43
 # so that it can be removed if tere are no apps which need it
43
 # so that it can be removed if tere are no apps which need it
130
     get_npm_arch
130
     get_npm_arch
131
 
131
 
132
     $mesh_install_nodejs_prefix npm config set unsafe-perm true
132
     $mesh_install_nodejs_prefix npm config set unsafe-perm true
133
+    if [ -f "$rootdir/usr/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js" ]; then
134
+        # fix for failing cpu detection during image build with qemu, see https://github.com/npm/npm/issues/19265
135
+        sed -i "s|require('os').cpus().length|1|g" "$rootdir/usr/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js"
136
+    fi
133
     $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g npm@${NPM_VERSION} --save
137
     $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g npm@${NPM_VERSION} --save
134
     if [ -f "$rootdir/usr/local/bin/npm" ]; then
138
     if [ -f "$rootdir/usr/local/bin/npm" ]; then
135
         cp "$rootdir/usr/local/bin/npm" /usr/bin/npm
139
         cp "$rootdir/usr/local/bin/npm" /usr/bin/npm