Bob Mottram 7 anni fa
parent
commit
7d02248a5d
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2
    2
      src/freedombone-utils-nodejs

+ 2
- 2
src/freedombone-utils-nodejs Vedi File

63
 function nodejs_fix_cpu_detection {
63
 function nodejs_fix_cpu_detection {
64
     # fix for failing cpu detection during image build with qemu, see https://github.com/npm/npm/issues/19265
64
     # fix for failing cpu detection during image build with qemu, see https://github.com/npm/npm/issues/19265
65
     if [ -f "$rootdir/usr/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js" ]; then
65
     if [ -f "$rootdir/usr/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js" ]; then
66
-        sed -i "s|require('os').cpus().length|(require('os').cpus() || { length: 1 }).length|g" "$rootdir/usr/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js"
66
+        sed -i "s/require('os').cpus().length/(require('os').cpus() || { length: 1 }).length/g" "$rootdir/usr/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js"
67
     fi
67
     fi
68
     if [ -f "$rootdir/.npm-global/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js" ]; then
68
     if [ -f "$rootdir/.npm-global/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js" ]; then
69
-        sed -i "s|require('os').cpus().length|(require('os').cpus() || { length: 1 }).length|g" "$rootdir/.npm-global/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js"
69
+        sed -i "s/require('os').cpus().length/(require('os').cpus() || { length: 1 }).length/g" "$rootdir/.npm-global/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js"
70
     fi
70
     fi
71
     # installing worker farm fixes the cpu detection bug
71
     # installing worker farm fixes the cpu detection bug
72
     $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g worker-farm@1.6.0 --save
72
     $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g worker-farm@1.6.0 --save