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

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

  • 相关阅读:
    Python学习笔记:断言
    Python学习笔记:反射
    Python学习笔记:异常处理
    Python学习笔记:面向对象
    Python学习笔记:模块学习
    Python学习笔记:解耦合
    flume配置
    李辉爱吴紫微
    python一个列表根据某个元素前后分割
    hadoop伪分布集群
  • 原文地址:https://www.cnblogs.com/hankuikui/p/9841838.html
Copyright © 2011-2022 走看看