15 lines
451 B
Bash
15 lines
451 B
Bash
#!/bin/bash
|
|
|
|
# Check if nodejs is installed
|
|
if ! which nodejs > /dev/null; then
|
|
#sudo mount -o remount,rw /
|
|
|
|
# Node.js is not installed, setting up the NodeSource Node.js 21.x repo
|
|
echo "Node.js not found. Setting up NodeSource Node.js 21.x repository..."
|
|
curl -fsSL https://deb.nodesource.com/setup_21.x | sudo -E bash -
|
|
|
|
# Install Node.js from the NodeSource repository
|
|
echo "Installing Node.js..."
|
|
sudo apt-get install -y nodejs
|
|
fi
|