问题描述
在进行npm install时,我电脑上挂了科学上网,导致需要切换代理。而国内的淘宝源也没有办法提速,甚至会导致卡顿,这致使我一直被折磨。
git的情况
这个情况曾经出现在git上,因为当时我的socks5代理为:127.0.0.1:10808,http代理为127.0.0.1:10809
我进行git设置
| git设置代理 |
|---|
| git config --global http.proxy http://127.0.0.1:10808 |
| git config --global https.proxy http://127.0.0.1:10808 |
导致无法顺利访问git,错误代码443.
- 解决方案:我将http代理改为了10809就可以了。
npm的情况
npm更换淘宝源,没有用
npm config set registry https://registry.npm.taobao.org
需要更换代理,和git一样
npm config set proxy http://127.0.0.1:10809