zoukankan      html  css  js  c++  java
  • npm install 报错 ECONNREFUSED

     在window环境下,使用npm install 命令安装任何框架,都会报如下的错误 

    16 error code ECONNREFUSED
    17 error errno ECONNREFUSED
    18 error FetchError: request to http://localhost:4873/vue failed, reason: connect ECONNREFUSED 127.0.0.1:4873
    18 error     at ClientRequest.req.on.err (C:Program Files
    odejs
    ode_modules
    pm
    ode_modulespacote
    ode_modulesmake-fetch-happen
    ode_modules
    ode-fetch-npmsrcindex.js:68:14)
    18 error     at emitOne (events.js:116:13)
    18 error     at ClientRequest.emit (events.js:211:7)
    18 error     at Socket.socketErrorListener (_http_client.js:387:9)
    18 error     at emitOne (events.js:116:13)
    18 error     at Socket.emit (events.js:211:7)
    18 error     at emitErrorNT (internal/streams/destroy.js:64:8)
    18 error     at _combinedTickCallback (internal/process/next_tick.js:138:11)
    18 error     at process._tickCallback (internal/process/next_tick.js:180:9)
    18 error  { FetchError: request to http://localhost:4873/vue failed, reason: connect ECONNREFUSED 127.0.0.1:4873

    它总是首先访问localhost:4873,这里肯定是有问题的,因为本地根本没有开启这个端口,

    是不是开了什么代理呢,使用npm config get proxy,发现结果为null

    最后一番折腾发现原因.npmrc有问题

    registry=http://localhost:4873/   #comment 
    ca=null

    把它注释掉,再执行安装就可以了

  • 相关阅读:
    123
    搭建https://github.com/vulhub/vulhub靶场_初稿
    【译】 渗透测试实战第三版(红队版)
    sqlmap
    fiddler一些高级用法
    安装django和selenium
    python中os模块
    python通过日志分析加入黑名单
    python简单的购物系统
    python文件操作
  • 原文地址:https://www.cnblogs.com/hankuikui/p/9841838.html
Copyright © 2011-2022 走看看