Condition to avoid cpu detection bug

This commit is contained in:
Bob Mottram 2018-04-03 18:06:58 +01:00
parent e02c86ddd3
commit 3c1e4e4e9f
1 changed files with 15 additions and 10 deletions

View File

@ -175,17 +175,22 @@ function mesh_install_nodejs {
# update from the old debian nodejs version # update from the old debian nodejs version
$mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g n@${NODEJS_N_VERSION} --save $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g n@${NODEJS_N_VERSION} --save
#$mesh_install_nodejs_prefix n --arch $N_ARCH ${NODEJS_VERSION} if [ ! "$rootdir" ]; then
#nodejs_fix_cpu_detection # Don't do this if we're building an image,
#cp "$rootdir/root/npm" "$rootdir/usr/bin/npm" # because cpu detection faults occur.
#cp "$rootdir/root/npm" "$rootdir/usr/local/bin/npm" # This condition may no longer be needed in future once the bug is fixed
$mesh_install_nodejs_prefix n --arch $N_ARCH ${NODEJS_VERSION}
nodejs_fix_cpu_detection
cp "$rootdir/root/npm" "$rootdir/usr/bin/npm"
cp "$rootdir/root/npm" "$rootdir/usr/local/bin/npm"
# deliberate second install of npm # deliberate second install of npm
#$mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g npm@${NPM_VERSION} --save $mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g npm@${NPM_VERSION} --save
#if [ -f "$rootdir/usr/local/bin/npm" ]; then if [ -f "$rootdir/usr/local/bin/npm" ]; then
# cp "$rootdir/usr/local/bin/npm" "$rootdir/usr/bin/npm" cp "$rootdir/usr/local/bin/npm" "$rootdir/usr/bin/npm"
#fi fi
#cp "$rootdir/usr/bin/npm" "$rootdir/root/npm" cp "$rootdir/usr/bin/npm" "$rootdir/root/npm"
fi
if [ -f "$rootdir/usr/bin/node" ]; then if [ -f "$rootdir/usr/bin/node" ]; then
cp "$rootdir/usr/bin/node" "$rootdir/usr/local/bin/node" cp "$rootdir/usr/bin/node" "$rootdir/usr/local/bin/node"
fi fi