自己写的npm包,之前每次更新都是正常发布,最近做个一个更新,想发布,然后npm publish 竟然失败,
错误提示如下:
npm ERR! network request to https://registry.npmjs.org/yy-org-switch failed, reason: connect ETIMEDOUT 104.16.16.35:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
截图如下:
意思就是连接不上 https://registry.npmjs.org, 在浏览器里访问这个网址果然访问不了,网上查了各种资料, 主要就是去掉npm淘宝源 或者 npm config set proxy=null 但是都不管用,
寻思着 是不是我电脑的问题,于是用手机访问 https://registry.npmjs.org 竟然可以访问,
那么试着手机开个热点,电脑连上手机的网络,再发布,成功了!
回头看上面的提示 : This is a problem related to network connectivity. 还真是网络连接的问题,但是为啥电脑之前的网络就访问不了,也还没找到问题,之前都还可以访问。
以后发布的时候就用手机开热点了。