Skip to content

Commit

Permalink
use nvm to install node
Browse files Browse the repository at this point in the history
  • Loading branch information
antobinary authored Aug 10, 2024
1 parent fa2719a commit 3b41df3
Showing 1 changed file with 36 additions and 14 deletions.
50 changes: 36 additions & 14 deletions bbb-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,21 +290,43 @@ main() {
need_ppa bigbluebutton-ubuntu-support-focal.list ppa:bigbluebutton/support 2E1B01D0E95B94BC # Needed for libopusenc0
need_ppa martin-uni-mainz-ubuntu-coturn-focal.list ppa:martin-uni-mainz/coturn 4B77C2225D3BBDB3 # Coturn

if [ -f /etc/apt/sources.list.d/nodesource.list ] && grep -q 18 /etc/apt/sources.list.d/nodesource.list; then
# Node 16 might be installed, previously used in BigBlueButton
# Remove the repository config. This will cause the repository to get
# re-added using the current nodejs version, and nodejs will be upgraded.
sudo rm -r /etc/apt/sources.list.d/nodesource.list
fi
if [ ! -f /etc/apt/sources.list.d/nodesource.list ]; then
sudo mkdir -p /etc/apt/keyrings
if [ -f /etc/apt/keyrings/nodesource.gpg ]; then
rm /etc/apt/keyrings/nodesource.gpg
fi
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=22
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
# install node

if command -v nvm &> /dev/null
then
echo "nvm is already installed."
else
echo "nvm is not installed."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.nvm/nvm.sh

Check warning

Code scanning / shellcheck

ShellCheck can't follow non-constant source. Use a directive to specify location. Warning

ShellCheck can't follow non-constant source. Use a directive to specify location.
fi
nvm install 22
nvm use 22
nvm alias default 22

node -v
nodejs -v
which node
which nodejs

# sudo apt remove nodejs


# if [ -f /etc/apt/sources.list.d/nodesource.list ] && grep -q 18 /etc/apt/sources.list.d/nodesource.list; then
# # Node 16 might be installed, previously used in BigBlueButton
# # Remove the repository config. This will cause the repository to get
# # re-added using the current nodejs version, and nodejs will be upgraded.
# sudo rm -r /etc/apt/sources.list.d/nodesource.list
# fi
# if [ ! -f /etc/apt/sources.list.d/nodesource.list ]; then
# sudo mkdir -p /etc/apt/keyrings
# if [ -f /etc/apt/keyrings/nodesource.gpg ]; then
# rm /etc/apt/keyrings/nodesource.gpg
# fi
# curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
# NODE_MAJOR=22
# echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
# fi

# postgres for BigBlueButton core
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
Expand Down

0 comments on commit 3b41df3

Please sign in to comment.