方法一

npm config set unsafe-perm=true  #可忽略不加
npm config set registry https://registry.npmmirror.com
git config --global url."https://gitclone.com/".insteadOf https://
npm install
//npm install  --ignore-scripts
npm run build

方法二cnpm

#已过期 npm install -g cnpm --registry=https://registry.npm.taobao.org
npm config set registry https://registry.npmmirror.com
npm install -g cnpm   #--registry=https://registry.npmmirror.com
cnpm install
npm run build
#也可
npm install -g cnpm --registry=https://registry.npmmirror.com
cnpm install
npm run build

方法三yarn

npm install -g yarn -registry=https://registry.npmmirror.com
yarn config set registry https://registry.npmmirror.com
yarn build

github加速

# 老版命令
git config --global url."https://gitclone.com/".insteadOf  "https://github.com/"
新版命令:参考地址 https://gitclone.com/docs/feature/gitclone_web
git config --global url."https://gitclone.com/".insteadOf https://