出现这种问题有好多种原因,可能是网络的问题也可能是node.js缓存的问题
解决的思路:
第一种方式:首先就是更换一下网络,用个人手机开热点试一下如果还是不行则用第二种方式
第二种方式:清楚缓存更换镜像
1. 查看当前的镜像网址
npm config get registry
2. 把npm的镜像地址改成taobao的
npm config set registry https://registry.npm.taobao.org
3. 检验是否设置成功
npm config get registry
4. 强制清理npm的缓存
npm cache clean --force
5. 设置镜像源
npm config set registry https://registry.npmmirror.com
6. 重新 install
npm install