#!/bin/bash if [ "$(id -u)" != "0" ] ; then echo "***********************需root权限***********************" exit 1 fi # 编写中... echo '开始安装nvm' cd ~ wget -qO- https://ghproxy.com/https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash if [ $? != "0" ] ; then echo '下载nvm失败' exit 1 fi cd ~/.nvm || exit source nvm.sh