Skip to content
Snippets Groups Projects
Commit 180b29bc authored by Bob Mottram's avatar Bob Mottram
Browse files

Don't specify architecture when doing node upgrades

parent 4f53f99c
No related branches found
No related tags found
No related merge requests found
......@@ -44,15 +44,15 @@ NODEJS_INSTALLED_APPS_FILE=$HOME/.nodejs-apps
function get_npm_arch {
N_ARCH='x86'
NPM_ARCH='ia32'
if [[ $ARCHITECTURE == 'arm'* ]]; then
if [[ "$ARCHITECTURE" == 'arm'* ]]; then
NPM_ARCH='armv7l'
N_ARCH='armv7l'
fi
if [[ $ARCHITECTURE == *"aarch"* ]]; then
if [[ "$ARCHITECTURE" == *"aarch"* ]]; then
NPM_ARCH='arm64'
N_ARCH='arm64'
fi
if [[ $ARCHITECTURE == 'x86_64' || $ARCHITECTURE == 'amd64' ]]; then
if [[ "$ARCHITECTURE" == 'x86_64' || $ARCHITECTURE == 'amd64' ]]; then
NPM_ARCH='x64'
N_ARCH='x64'
fi
......@@ -155,8 +155,13 @@ function nodejs_install_npm {
$mesh_install_nodejs_prefix npm config set unsafe-perm true
nodejs_setup_global_modules
nodejs_fix_cpu_detection
echo $"Installing npm ${NPM_VERSION} on ${NPM_ARCH}"
$mesh_install_nodejs_prefix npm install --arch=${NPM_ARCH} -g npm@${NPM_VERSION} --save
if [ $NODE_UPGRADE ]; then
echo $"Installing npm ${NPM_VERSION}"
npm install -g npm@${NPM_VERSION} --save
else
echo $"Installing npm ${NPM_VERSION} on ${NPM_ARCH}"
$mesh_install_nodejs_prefix npm install --arch=${NPM_ARCH} -g npm@${NPM_VERSION} --save
fi
# NOTE: trying to copy here breaks the build
#if [ -f "$rootdir/.npm-global/bin/npm" ]; then
# cp "$rootdir/.npm-global/bin/npm" "$rootdir/usr/local/bin/npm"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment