node安装 (by nvm)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc 
nvm install 16.20
$ node -v
v16.20.2

npm换源 (by nrm)

npm install nrm -g
user@u2404-server:~$ nrm ls
  npm ---------- https://registry.npmjs.org/
  yarn --------- https://registry.yarnpkg.com/
  tencent ------ https://mirrors.tencent.com/npm/
  cnpm --------- https://r.cnpmjs.org/
  taobao ------- https://registry.npmmirror.com/
  npmMirror ---- https://skimdb.npmjs.com/registry/
  huawei ------- https://repo.huaweicloud.com/repository/npm/
user@u2404-server:~$ nrm test
  npm ---------- 900 ms
  yarn --------- 936 ms
  tencent ------ 513 ms
  cnpm --------- 1015 ms
  taobao ------- 101 ms
  npmMirror ---- 874 ms (Fetch error, if this is your private registry, please ignore)
  huawei ------- 366 ms
 
user@u2404-server:~$ nrm use taobao
 SUCCESS  The registry has been changed to 'taobao'.
 
# nrm add/del srcname srcurl