#!
/bin/bash
# Atualizar pacotes e instalar dependências básicas
pkg update -y && pkg upgrade -y
pkg install -y curl git wget openssl-tool
# Instalar [Link] (versão LTS) via fnm (gerenciador de versões)
curl -fsSL [Link] | bash
source ~/.bashrc
# Instalar [Link] LTS e setar como padrão
fnm install --lts
fnm default $(fnm list | grep lts | awk '{print $2}' | head -n 1)
# Instalar Yarn e utilitários
npm install -g yarn pm2 typescript nodemon
# Instalar dependências de compilação (para pacotes nativos)
pkg install -y python make clang libcrypt
# Configurar ambiente para evitar problemas com pacotes nativos
echo 'export PATH=$HOME/.fnm:$PATH' >> ~/.bashrc
echo 'export LDFLAGS="-L/data/data/[Link]/files/usr/lib"' >> ~/.bashrc
echo 'export CPPFLAGS="-I/data/data/[Link]/files/usr/include"' >> ~/.bashrc
source ~/.bashrc
# Verificar instalações
echo "=== Versões instaladas ==="
node -v
npm -v
yarn -v
tsc -v
echo "✅ JavaScript environment instalado com sucesso!"
echo "Ferramentas incluídas: [Link], npm, Yarn, TypeScript, PM2, Nodemon"