提问人:LokiTheShady 提问时间:11/13/2023 更新时间:11/13/2023 访问量:34
npm install 尝试从 localhost 安装
Npm install tries to install from localhost
问:
当我尝试运行逗号时
npm install http
在给我这个错误之前,它挂起了一段时间
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to https://localhost/http failed, reason:
npm ERR! at ClientRequest.<anonymous> (C:\Users\Barth\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
npm ERR! at ClientRequest.emit (node:events:514:28)
npm ERR! at _destroy (node:_http_client:875:13)
npm ERR! at onSocketNT (node:_http_client:895:5)
npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! FetchError: request to https://localhost/http failed, reason:
npm ERR! at ClientRequest.<anonymous> (C:\Users\Barth\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
npm ERR! at ClientRequest.emit (node:events:514:28)
npm ERR! at _destroy (node:_http_client:875:13)
npm ERR! at onSocketNT (node:_http_client:895:5)
npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR! code: 'ECONNREFUSED',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! type: 'system',
npm ERR! requiredBy: '.'
npm ERR! }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly. See: 'npm help config'
如您所见,它尝试从 https://localhost/http 是什么原因造成的,我该如何解决这个问题
我已经尝试过完全重新安装节点
答:
0赞
stratov
11/13/2023
#1
确保 npm 注册表设置正确。您可以使用以下命令检查和更新注册表:
npm config get registry
npm config set registry https://registry.npmjs.org/
我希望这对其他人也有帮助。
评论
npm config get registry
npm config set registry https://registry.npmjs.org/