1.首先安装homebrew
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"
查看安装是否成功 brew --v
2. 安装node
brew install node
坚持node npm 是否安装完成
node -v
npm -v
3.安装淘宝镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
如果提示权限不够
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org