npm安装依赖超时,报错npm error code ECONNRESET

1
2
3
4
5
6
7
8
9
npm error code ECONNRESET
npm error syscall read
npm error errno ECONNRESET
npm error network Invalid response body while trying to fetch https://registry.npmjs.org/element-plus: read ECONNRESET
npm error network This is a problem related to network connectivity.
npm error network In most cases you are behind a proxy or have bad network settings.
npm error network
npm error network If you are behind a proxy, please make sure that the
npm error network 'proxy' config is set properly. See: 'npm help config'

切换淘宝源:

1
npm config set registry https://registry.npmmirror.com