Npm install尝试从localhost安装

ykejflvf  于 11个月前  发布在  其他
关注(0)|答案(1)|浏览(117)

当我试图运行comman

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安装它是什么原因导致这一点,我如何修复这一点
我已经尝试完全恢复节点

p5fdfcr1

p5fdfcr11#

确保您的npm注册表设置正确。您可以使用以下命令检查和更新注册表:
第一个月
npm config set registry https://registry.npmjs.org/
我希望这也能对其他人有所帮助。

相关问题