gpt4 book ai didi

angularjs - 错误 : getaddrinfo ENOTFOUND registry. npmjs.org registry.npmjs.org:443

转载 作者:IT老高 更新时间:2023-10-28 22:12:54 27 4
gpt4 key购买 nike

我在公司网络上工作。

尝试安装 npm. 但我一次又一次地收到此错误。

$ npm install
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.1.0
npm ERR! npm v3.8.6
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo

npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is 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'

npm ERR! Please include the following file with any support request:
npm ERR! C:\Angular-test\angular-phonecat\npm-debug.log

也试过这个:npm config set registry https://registry.npmjs.org/

仍然遇到同样的错误。

最佳答案

要尝试的事情:

  1. 确保您有互联网连接:ping 8.8.8.8
  2. 确保您的 DNS 解析器正常工作:ping www.google.com
  3. 确保您可以访问 registry.npmjs.org:ping registry.npmjs.org
  4. 确保您可以通过 https 连接。

在您的浏览器中尝试:https://registry.npmjs.org/

确保您正在尝试连接到:

  • registry.npmjs.org

而不是:

  • “registry.npmjs.org registry.npmjs.org:443”

或其他由少数主机名组成的奇怪字符串,因为解析器提示包含端口号的主机名很奇怪,它不应该关心。好的,我测试过了,没有找到的主机应该是这样的。

更新

从您对此答案的评论看来,如果您甚至无法 ping 8.8.8.8,您似乎没有直接连接到互联网。

如果您使用代理来访问 Web,那么您还必须配置 npm 才能使用它。使用:

npm config set proxy http://example.com:8080
npm config set https-proxy http://example.com:8080

但不要使用 http://example.com:8080,而是使用您公司实际需要的东西 - 询问某人或查看您的浏览器是如何配置的。

要在 Chrome 中查看您的代理配置,请参阅 this .

更新 2

如果您可以访问https://registry.npmjs.org/在您的浏览器中,但您无法运行 ping registry.npmjs.org 那么这意味着您的浏览器必须配置为使用代理,或者您的浏览器以外的其他程序必须受到限制避免使用互联网。

在任何情况下,您都应该询问公司中的某个人,因为您很可能需要使用特定的代理,或者有人需要解除您的 npm 的限制并允许它访问网络。

您的计算机上安装的防火墙或网络中的路由器可能会阻止网络访问。不知道贵公司的具体配置很难说。

更新 3

删除环境变量“https_proxy”(如果有)或为“https_proxy”使用正确的值

关于angularjs - 错误 : getaddrinfo ENOTFOUND registry. npmjs.org registry.npmjs.org:443,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39592908/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com