收起左侧

nas 使用npm install提示网络超时

1
回复
21
查看
[ 复制链接 ]

2

主题

1

回帖

0

牛值

江湖小虾

悬赏1飞牛币未解决

我想在飞牛中安装 npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com/ --force-ipv4
错误提示如下

46 verbose stack FetchError: request to https://mirrors.cloud.tencent.com/npm/@anthropic-ai%2fclaude-code failed, reason: connect ETIMEDOUT 2408:875c:0:80::6c:443
46 verbose stack at ClientRequest. (/usr/share/nodejs/minipass-fetch/lib/index.js:130:14)
46 verbose stack at ClientRequest.emit (node:events:517:28)
46 verbose stack at TLSSocket.socketErrorListener (node:_http_client:501:9)
46 verbose stack at TLSSocket.emit (node:events:529:35)
46 verbose stack at emitErrorNT (node:internal/streams/destroy:151:8)
46 verbose stack at emitErrorCloseNT (node:internal/streams/destroy:116:3)
46 verbose stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
47 verbose cwd /home/IMCFY
48 verbose Linux 6.12.18-trim
49 verbose node v18.20.4
50 verbose npm v9.2.0
51 error code ETIMEDOUT
52 error syscall connect
53 error errno ETIMEDOUT
54 error network request to https://mirrors.cloud.tencent.com/npm/@anthropic-ai%2fclaude-code failed, reason: connect ETIMEDOUT 2408:875c:0:80::6c:443
55 error network This is a problem related to network connectivity.
55 error network In most cases you are behind a proxy or have bad network settings.
55 error network
55 error network If you are behind a proxy, please make sure that the
55 error network 'proxy' config is set properly. See: 'npm help config'
56 verbose exit 1
57 timing npm Completed in 472485ms

我已经做过几个尝试

1.换了国内的 淘宝镜像 npmmirror.com, 阿里镜像
2. 看错误使用的是ipv6.但是已经使用force-ipv4

收藏
送赞
分享

2

主题

1

回帖

0

牛值

江湖小虾

昨天 21:11 楼主 显示全部楼层
已解决,加个代理
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则