From 87523da8d4e92931e548aa64a21858d657e461ad Mon Sep 17 00:00:00 2001 From: wangqifan Date: Sun, 15 Mar 2026 18:06:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20install=5Fnode22.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install_node22.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 install_node22.sh diff --git a/install_node22.sh b/install_node22.sh new file mode 100644 index 0000000..537085a --- /dev/null +++ b/install_node22.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e + +echo "===== Update system =====" +apt update -y +apt install -y curl ca-certificates gnupg + +echo "===== Install Node.js 22 =====" +curl -fsSL https://deb.nodesource.com/setup_22.x | bash - +apt install -y nodejs + +echo "===== Enable Corepack =====" +corepack enable + +echo "===== Install pnpm =====" +corepack prepare pnpm@latest --activate + +echo "===== Install PM2 =====" +npm install -g pm2 + +echo "===== Install build tools =====" +apt install -y build-essential + +echo "===== Version check =====" +node -v +npm -v +pnpm -v +pm2 -v + +echo "===== Install complete =====" \ No newline at end of file