initial commit
This commit is contained in:
29
install/node.sh
Executable file
29
install/node.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "==> Setting up Node.js..."
|
||||
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
|
||||
if [ -d "$NVM_DIR" ]; then
|
||||
echo " nvm already installed, loading..."
|
||||
. "$NVM_DIR/nvm.sh"
|
||||
else
|
||||
echo " installing nvm..."
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
|
||||
. "$NVM_DIR/nvm.sh"
|
||||
fi
|
||||
|
||||
echo " installing node LTS..."
|
||||
nvm install --lts
|
||||
nvm use --lts
|
||||
nvm alias default node
|
||||
|
||||
echo "==> Installing pnpm..."
|
||||
if command -v pnpm &>/dev/null; then
|
||||
echo " pnpm already installed: $(pnpm --version)"
|
||||
else
|
||||
npm install -g pnpm
|
||||
fi
|
||||
|
||||
echo "==> Node done."
|
||||
Reference in New Issue
Block a user