Update install_netdata

Changed NVM support to use whatever is /usr/bin/node whether the RPM package or the symbolic link to the desired node version. This makes the node version is dependent on the symbolic link or the RPM package location. When NVM is used though this script, it will use the RPM or create a symbolic link to the set version of Node.JS.
This commit is contained in:
LPJon
2023-08-31 04:28:50 -05:00
committed by GitHub
parent f3f5c080e2
commit ec3f05e441

View File

@@ -40,10 +40,10 @@ function installnodeJS {
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install $nodeversion
nvm use $nodeversion
if [ "$(getsystemnodeversion)" != "v$nodeversion" ]; then
ln -sf /root/.nvm/versions/node/v"$nodeversion"/bin/node /usr/bin/node
fi
nvm use system
fi
if [ ! -e "$HOME/.nvm" ]; then
yum -y install curl
@@ -51,9 +51,9 @@ function installnodeJS {
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install "$nodeversion"
nvm use "$nodeversion"
ln -sf /root/.nvm/versions/node/v"$nodeversion"/bin/node /usr/bin/node
nvm use system
fi
fi
}