首先下载10.x版本的node,比如安装10.x
wget -qO- https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
# 查看版本
node -v
sudo apt install npm
npm i -g npm //最新版本
npm i -g npm@6.13.4//指定版本
原文:https://www.cnblogs.com/ycx95/p/12123237.html