使用VPN时无法下载NPM软件包

发布于 2025-01-29 21:27:11 字数 677 浏览 3 评论 0原文

每当我尝试从vscode或我的CMD连接到VPN(我的情况下的psiphon)时,我尝试从NPM(或YARN)下载任何软件包时,它似乎不起作用了,过了一会儿就可以了这样的错误

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.com/nodemon failed, reason: getaddrinfo ENOTFOUND 28
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'`
I 

但是,

如果我与VPN断开连接,那么一切都很好。 我真的需要连接到VPN。

请任何建议将不胜感激。 预先感谢

Any time I try downloading any package from npm (or yarn) while I am connected to a vpn (psiphon in my case) in vscode or my cmd (am using windows 10) it doesn't seem to work and after a while it throws an error like this

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.com/nodemon failed, reason: getaddrinfo ENOTFOUND 28
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'`
I 

But

If I disconnect from the vpn everything thing works fine ????.
And I really need to be connected to the vpn.

Please any suggestions will be highly appreciated.
Thanks in advance ????

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绝不服输 2025-02-05 21:27:11

如果您已经用尽了所有通用解决方案,请尝试以此等效的Windows:

export NODE_OPTIONS=--dns-result-order=ipv4first

If you've already exhausted all of the common solutions, try the Windows equivalent this:

export NODE_OPTIONS=--dns-result-order=ipv4first
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文