npm version change
# 更换指定版本
npm -g install [email protected]
# 更换最新版本
npm install -g npm
Node version replacement
nvm: node version management tool , which can operate node version switching, installation, viewing ,
etc.
# 查看当前node版本
nvm -v
# 查看已安装node版本
nvm ls
# 安装对应vXX版本的node
nvm install 14.18.0
# 选择使用14.18.0版本 切无需修改系统环境变量等,轻松无缝切换各版本;
nvm use 14.18.0
# 版本列表
nvm list
# 卸载对应v16.15.1版本的node
nvm uninstall 16.15.1
nrm to npm source switching
nrm: npm source manager, allows you to quickly switch between npm sources.
# 安装nrm
npm instal -g nrm
# npm可选源列表
nrm ls
# 查看当前源
nrm current
# 切换源 taobao
nrm use taobao
# 添加源
nrm add tencent https://mirrors.cloud.tencent.com/npm/
# 删除源
nrm del tencent
# 测试源传输速度
nrm test taobao