第一步,去官网看看当前最新的版本是多少,比如当前最新是v18.12.0
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
第二步,执行安装
apt install -y nodejs