nvm 包管理器
npm 更改下载源为淘宝镜像
npm install --registry=https://registry.npm.taobao.org
npm config set registry=https://registry.npm.taobao.org
npm config get registry 或者 npm info express
npm config set registry https://registry.npmjs.org/
mac 下安装 nvm
cd ~
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
vim ~/.zshrc
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
vim ~/.bashrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm 相关命令
nvm -v
nvm list available
nvm install 10.15.0
nvm use 10.15.0
nvm install 8.11.2
nvm use 8.11.2
nvm list
nvm uninstall 8.11.2