在root下升级Node.js到22+

在root下升级Node.js到22+
使用NodeSource安装Node.js 22

1. 卸载现有Node.js(可选)

apt-get remove -y nodejs npm

2. 清理残留

apt-get autoremove -y

3. 添加NodeSource仓库

curl -fsSL https://deb.nodesource.com/setup_22.x | bash -

4. 安装Node.js 22

apt-get install -y nodejs

5. 验证安装

node --version
npm --version