使用热点无线时的 npm 连接问题

问题描述

我正在开发一个网站,并经常在本地运行服务器和客户端进行测试。据我所知,这是一个没有代理的家用计算机设置。我的设置工作了好几个月,但在执行“wsl --shutdown”以解决另一个问题后不久,我的服务器无法再连接到互联网。客户没问题。使用“ping”检查连接永远不会返回任何结果。我似乎可以发送信息,但无法接收,因为总是 100% 丢包。

我的设置的一个特点是我专门使用移动热点来访问互联网。一件奇怪的事情是每次我投影热点时我的IP地址都会改变。

我在 Windows 10 内的 wsl2 上进行开发,但是当我无法让它工作时,我尝试直接在 Windows 上开始开发。但我也无法从 Windows 上的 cmd 或 powershell 终端访问互联网。

我尝试了很多东西,包括:

  1. npm 配置集注册表 http://registry.npmjs.org/

  2. npm 配置 rm 代理 npm 配置 rm https-proxy npm install npm@latest -g

  3. 将“命名空间 8.8.8.8”添加到各种配置文件

...还有其他一些事情。这些似乎都没有任何影响。在这一点上,我可能还通过更改我不应该拥有的设置来使问题变得更糟。任何适用于 Windows 的 wsl2 或直接在 Windows 上的全新启动解决方案都将不胜感激。

Windows Powershell 失败命令和输出示例:

PS C:\Users\user\Code\> npm install
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to http://registry.npmjs.org/@hapi%2faddress failed,reason: read ECONNRESET
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'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...