安装node
访问官网:https://deb.nodesource.com/
找到安装命令
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
sudo apt-get install -y nodejs
查看是否安装成功
node -v
安装国内镜像源
npm get registry
npm config set registry https://registry.npmmirror.com/
安装pm2
npm install pm2 -g