1、检查npm版本,进行升级或者降级处理
sudo npm install npm@6.13.1 -g
2、检查npm registry配置,进行替换
npm config list
npm config set registry "https://registry.npmjs.com/"
List of Npm registry:
https://registry.npmjs.org/ (Dfault One)
http://r.cnpmjs.org/
https://registry.npm.taobao.org/
https://registry.nodejitsu.com/
http://registry.mirror.cqupt.edu.cn
https://skimdb.npmjs.com/registry
3、清理缓存
npm cache clear --force
npm verify cache
4、重启terminal
5、rm -rf node_modules/ && npm install