mirror of
https://github.com/LPJon/cwpfixes.git
synced 2026-09-10 22:20:47 -05:00
Update install_terminal
Added support for NVM (Node Version Manager)
This commit is contained in:
@@ -2,18 +2,34 @@
|
|||||||
# CWP INSTALL APP TERMINAL
|
# CWP INSTALL APP TERMINAL
|
||||||
yum -y update ca-certificates
|
yum -y update ca-certificates
|
||||||
|
|
||||||
if [ ! -e "/usr/bin/node" ];then
|
# NEW CODE
|
||||||
yum -y install nodejs --enablerepo=epel
|
# Use NVM for node.js installation management. Options are "y" or "n" DEFAULT = n
|
||||||
cd /root
|
usenvm=n
|
||||||
npm cache clean -f
|
# Version of Node.js to install. DEFAULT = 16.18.1
|
||||||
npm install -g n
|
nodeversion=16.18.1
|
||||||
n stable
|
|
||||||
PATH="$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e "/usr/bin/npm" ];then
|
if [ "$usenvm" == "n" ]; then
|
||||||
|
if [ ! -e "/usr/bin/node" ];then
|
||||||
|
yum -y install nodejs --enablerepo=epel
|
||||||
|
cd /root
|
||||||
|
npm cache clean -f
|
||||||
|
npm install -g n
|
||||||
|
n stable
|
||||||
|
PATH="$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "/usr/bin/npm" ];then
|
||||||
yum -y install npm --enablerepo=epel
|
yum -y install npm --enablerepo=epel
|
||||||
cd /root
|
cd /root
|
||||||
|
fi
|
||||||
|
elif [ "$usenvm" == "y" ]; then
|
||||||
|
if [ ! -d "$HOME/.nvm" ]; then
|
||||||
|
yum -y install curl
|
||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
|
||||||
|
source ~/.bashrc
|
||||||
|
nvm install "$nodeversion"
|
||||||
|
nvm use "$nodeversion"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Old Code
|
# Old Code
|
||||||
|
|||||||
Reference in New Issue
Block a user