1.切换镜像源
//淘宝镜像(腾讯云贼慢)
npm config set registry https://registry.npm.taobao.org
//华为云镜像
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
//验证命令
npm config get registry
2.使用cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
3.linux安装node.js
wget https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz
tar -zxvf node-v4.4.7-linux-x64.tar.gz
export PATH=$PATH:/opt/node-v4.4.7-linux-x64/bin
yum install -y nodejs