1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| #!/bin/bash
if which node >/dev/null 2>&1; then echo "Node.js 已安装。" else echo "Node.js 未安装。"
mkdir -p /home/.node cd /home/.node curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash nvm install 22
echo "node.js v22.5.0版本安装成功" fi
|