【npm】项目安装失败问题
【npm】项目安装失败问题
问题描述
安装npm项目时报错
排查
注意到访问的不是官方的地址,是https://hub.fastgit.xyz/eligrey/FileSaver.js.git/,想到可能是之前配置过的一个映射加速节点
果然发现了这个配置
解决方案
删除这个配置
删除之后依然不行,- -!
ping github.com也不通,同事的电脑可以ping通,就怀疑dns有问题,去查了hosts,果然之前配了一个路由,删掉就好了。
后面又遇到了npm node版本不对的问题,头大。
相关命令
## 清除缓存
npm cache clean --force
## 添加配置
git config [--local|--global|--system] section.key value
## 删除配置
git config [--local|--global|--system] --unset section.key