-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_nodejs.sh
More file actions
executable file
·47 lines (45 loc) · 1.34 KB
/
install_nodejs.sh
File metadata and controls
executable file
·47 lines (45 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
echo "🚀 Node.js Installation Guide"
echo "============================="
echo ""
# Check if Node.js is already installed
if command -v node &> /dev/null; then
echo "✅ Node.js is already installed!"
echo " Version: $(node --version)"
echo " npm: $(npm --version)"
exit 0
fi
echo "❌ Node.js is not installed"
echo ""
echo "Please choose an installation method:"
echo ""
echo "Method 1: Using nvm (Recommended)"
echo "-----------------------------------"
echo "Run these commands:"
echo ""
if command -v wget &> /dev/null; then
echo " wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash"
else
echo " # Download install script first, then:"
echo " bash install.sh"
fi
echo " source ~/.bashrc"
echo " nvm install 18"
echo " nvm use 18"
echo ""
echo "Method 2: Using apt (Requires sudo)"
echo "-----------------------------------"
echo " sudo apt update"
echo " sudo apt install -y nodejs npm"
echo ""
echo "Method 3: Manual download"
echo "-------------------------"
echo " 1. Visit: https://nodejs.org/"
echo " 2. Download Linux x64 binary"
echo " 3. Extract and add to PATH"
echo ""
echo "After installation, run:"
echo " cd /home/mayank/Downloads/HackCBS_VUCA"
echo " npm install --legacy-peer-deps"
echo " echo 'VITE_API_URL=http://localhost:8000' > .env"
echo " npm run dev"