diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs index 2b02db86..1c1b484d 100755 --- a/src/freedombone-utils-nodejs +++ b/src/freedombone-utils-nodejs @@ -127,6 +127,28 @@ function mesh_install_nodejs { $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} cp $rootdir/root/npm $rootdir/usr/bin/npm + + # check the version numbers + cat < $rootdir/usr/bin/test_nodejs_install +#!/bin/bash +node_version=\$(node -v) +if [[ "\$node_version" != "v${NODEJS_VERSION}" ]]; then + echo $"nodejs version expected to be ${NODEJS_VERSION} but found \$node_version" + exit 1 +fi +npm_version=\$(npm -v) +if [[ "\$npm_version" != "v${NPM_VERSION}" ]]; then + echo $"npm version expected to be ${NPM_VERSION} but found \$npm_version" + exit 2 +fi +EOF + chmod +x $rootdir/usr/bin/test_nodejs_install + chroot "$rootdir" /usr/bin/test_nodejs_install + if [ ! "$?" = "0" ]; then + echo $"nodejs version numbers did not match. Architecture is $NPM_ARCH." + exit 76835282 + fi + rm $rootdir/usr/bin/test_nodejs_install } function remove_nodejs {