diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs index 032e0ac2..7e06fa79 100755 --- a/src/freedombone-utils-nodejs +++ b/src/freedombone-utils-nodejs @@ -98,16 +98,25 @@ function mesh_install_nodejs { fi $mesh_install_nodejs_prefix apt-get -yq install nodejs - - if [ ! -f ${rootdir}/usr/bin/nodejs ]; then - echo $'nodejs was not installed' - exit 63962 + CURR_NODE_VERSION=$(node --version) + if [[ "$CURR_NODE_VERSION" != "v${NODEJS_VERSION}" ]]; then + echo $"Expected node version $NODEJS_VERSION but actually have $CURR_NODE_VERSION" + exit 5274527 fi if [ -f $rootdir/usr/bin/nodejs ]; then cp $rootdir/usr/bin/nodejs $rootdir/usr/bin/node fi + if [ ! -f ${rootdir}/usr/bin/node ]; then + if [ ! -f ${rootdir}/usr/local/bin/node ]; then + if [ ! -f ${rootdir}/usr/bin/nodejs ]; then + echo $'nodejs was not installed' + exit 63962 + fi + fi + fi + if [ ! -f $rootdir/usr/bin/node ]; then echo $'/usr/bin/node not found' exit 7235728