You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows环境下配置代理后使用npm安装Ionic仍失败求助

Fixing ECONNREFUSED Error When Installing Ionic/Cordova via npm

Looks like your npm can’t establish a connection to your proxy server at proxyip:8080—that’s exactly what the connect ECONNREFUSED proxyip:8080 error is signaling. Let’s work through this step by step to get it sorted:

1. First, Verify Your Proxy Server is Reachable

Before digging into npm settings, confirm the proxy itself is accessible from your machine:

  • Run this curl command to test connectivity to the npm registry through your proxy:
    curl -x http://username:password@proxyip:8080/ http://registry.npmjs.org/bn.js
    
  • If this command fails with the same ECONNREFUSED error, the problem isn’t with npm—it’s with your proxy setup:
    • Double-check the proxy IP address and port number (8080) for typos.
    • Confirm the proxy server is running and accepting connections from your device.
    • Verify your proxy username and password are correct (note: special characters in credentials need URL encoding, e.g., @ becomes %40, : becomes %3A).

2. Double-Check Your npm Proxy Configuration

Let’s make sure your npm settings are correctly applied and error-free:

  • List all current npm configs to review:
    npm config list
    
  • Cross-verify these key values:
    • proxy and https-proxy should match the exact URL of your proxy (including username/password if required).
    • registry is set to http://registry.npmjs.org/ (this is correct, but if your proxy allows HTTPS, you could try switching to https://registry.npmjs.org/ later).
    • strict-ssl false is okay here since you’re using an HTTP registry.

3. Rule Out Local Network Blockages

  • Firewall/Antivirus: Your local firewall or antivirus software might be blocking npm from accessing the proxy port (8080). Try temporarily disabling them (if permitted) and re-run the install command.
  • Corporate Network Restrictions: If you’re on a work network, reach out to your IT team to confirm your machine is allowed to use the proxy, and that port 8080 isn’t restricted.

4. Clear npm Cache and Retry

Corrupted cache can sometimes cause unexpected connection glitches:

  • Clear the npm cache with:
    npm cache clean --force
    
  • Then try installing Ionic and Cordova again:
    npm install -g ionic cordova
    

内容的提问来源于stack exchange,提问作者Nithya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 06:53:16