gpt4 book ai didi

node.js - 海外安装 NPM 超时

转载 作者:行者123 更新时间:2023-12-02 20:26:10 25 4
gpt4 key购买 nike

我正在美国境外度假,那里的连接速度非常慢,npm install 给我带来了一些麻烦。

› npm config list
; cli configs
user-agent = "npm/3.7.3 node/v5.8.0 darwin x64"

; userconfig /Users/lfender/.npmrc
registry = "http://registry.npmjs.org/"
strict-ssl = false

; globalconfig /Users/lfender/.nvm/versions/node/v5.8.0/etc/npmrc
strict-ssl = false

; node bin location = /Users/lfender/.nvm/versions/node/v5.8.0/bin/node
; cwd = /Users/lfender/source/ag.js
; HOME = /Users/lfender
; "npm config ls -l" to show all defaults.

npm install --verbose
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.56.162:443

我已尝试将注册表设置为 http,但看起来它仍在尝试通过 443 或 ssl 进行连接。

它会继续执行此操作并一遍又一遍地重试。我还可以尝试什么来与注册表建立通信?

即使连接到位于美国的公司 VPN,它仍然失败。

npm ERR! network connect ETIMEDOUT 151.101.56.162: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 verb exit [ 1, true ]

我怀疑这是 ISP 的问题

最佳答案

我在慢速互联网上遇到了类似的问题,并且在实验中我发现我们可以设置超时值。所以,做

npm install -timeout=9999999

对我有用,因为它将超时设置为 9999999 毫秒。

关于node.js - 海外安装 NPM 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39830049/

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