1. 安裝nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
The script clones the nvm repository to ~/.nvm and adds the source line to your profile (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc).
2. 安裝node
nvm install 8.5.0
3. 配置npm使用淘寶鏡像
npm --registry https://registry.npm.taobao.org info underscore
4. 安裝pm2
nvm i -g pm2