发布 npm 包推送到官方库时 提示 connect ETIMEDOUT
今天在推送npm包时, 提示报错 :
error network request to https://registry.npmjs.org/microi-pageengine failed, reason: connect ETIMEDOUT 104.16.2.35:443
什么都没配置的好好的,之前也没问题,也清理了npm 缓存 ,还是一直提示如下错误:
error code ETIMEDOUT
36 error syscall connect
37 error errno ETIMEDOUT
38 error network request to https://registry.npmjs.org/microi-pageengine failed, reason: connect ETIMEDOUT 104.16.2.35:443
39 error network This is a problem related to network connectivity.
39 error network In most cases you are behind a proxy or have bad network settings.
39 error network
39 error network If you are behind a proxy, please make sure that the
39 error network 'proxy' config is set properly. See: 'npm help config'
最后发现是DNS 解析问题
尝试刷新 DNS 缓存:
#Windows 下执行
ipconfig /flushdns
#macOS/Linux 下执行
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
问题解决!!!