NodeJS npm 无法访问互联网。冻结几分钟后错误代码 ETIMEDOUT

NodeJS npm 无法访问互联网。冻结几分钟后错误代码 ETIMEDOUT

我试图安装 Nodejs 项目的模块。我运行了npm i它,由于某种原因冻结在添加模块时显示的进度条上,几分钟后,它最终出现一个错误:

https://registry.npmjs.org/bcrypt failed, reason: connect ETIMEDOUT 2606:4700:83b3:80e2:e43b:1d:6810:1023:443
65 verbose stack     at ClientRequest.<anonymous> (/usr/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
65 verbose stack     at ClientRequest.emit (node:events:512:28)
65 verbose stack     at TLSSocket.socketErrorListener (node:_http_client:495:9)
65 verbose stack     at TLSSocket.emit (node:events:524:35)
65 verbose stack     at emitErrorNT (node:internal/streams/destroy:151:8)
65 verbose stack     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
65 verbose stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
66 verbose cwd /home/rick/GoogleSolutions_Project_Backend
67 verbose Linux 5.19.0-35-generic
68 verbose node v19.8.1
69 verbose npm  v9.5.1
70 error code ETIMEDOUT
71 error syscall connect
72 error errno ETIMEDOUT
73 error network request to https://registry.npmjs.org/bcrypt failed, reason: connect ETIMEDOUT 2606:4700:83b3:80e2:e43b:1d:6810:1023:443
74 error network This is a problem related to network connectivity.
74 error network In most cases you are behind a proxy or have bad network settings.
74 error network
74 error network If you are behind a proxy, please make sure that the
74 error network 'proxy' config is set properly.  See: 'npm help config'
75 verbose exit 1
76 timing npm Completed in 3225842ms
77 verbose unfinished npm timer reify 1679241527055
78 verbose unfinished npm timer reify:loadTrees 1679241527057
79 verbose code 1
80 error A complete log of this run can be found in:
80 error     /home/rick/.npm/_logs/2023-03-19T15_58_47_022Z-debug-0.log

我尝试使用安装全局包npm i -g bootstrap,但仍然出现相同的错误。

完整日志:https://pastebin.com/Y2XrJgHR
操作系统版本:Ubuntu Jammy 22.04 LTS

相关内容