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

公司代理环境下Ionic创建应用卡在npm i步骤求助

Troubleshooting npm install hang-up in Ionic under corporate proxy

Hey there! It sounds like you're hitting a common roadblock when working with npm behind a company proxy—let's walk through how to fix this stuck npm i step when creating your first Ionic app.

First, address the most likely culprit: Proxy configuration

Corporate proxies often block npm's access to the public registry, so we need to make sure npm is set up to use your company's proxy correctly.

  • Set npm proxy settings
    Run these commands in your terminal, replacing your-proxy-address:port with your actual company proxy details (add username:password@ before the address if your proxy requires authentication):

    npm config set proxy http://your-proxy-address:port
    npm config set https-proxy http://your-proxy-address:port
    
  • Verify the npm registry
    Make sure npm is pointing to the correct public registry (sometimes proxies or previous configs can alter this):

    npm config get registry
    

    If it's not https://registry.npmjs.org/, reset it with:

    npm config set registry https://registry.npmjs.org/
    

Next, clear npm cache and reset dependencies

Stale cache or corrupted partial installs can cause hangs too:

  1. Force clear the npm cache:
    npm cache clean --force
    
  2. Navigate to your hello_ionic project folder, delete the node_modules folder and package-lock.json file (if they exist).
  3. Try running npm install again manually.

Additional fixes to try

  • Update Ionic and npm
    Outdated versions can have compatibility issues with proxies. Update both to the latest versions:

    npm install -g @ionic/cli
    npm install -g npm@latest
    
  • Disable strict SSL temporarily
    Some corporate proxies use self-signed certificates that npm rejects. You can turn off strict SSL checking (note: this is a temporary workaround—ask your IT team for the correct certificate to install long-term):

    npm config set strict-ssl false
    
  • Create the project without auto-installing dependencies
    If the ionic start command still hangs during npm i, create the project first and install dependencies manually:

    ionic start hello_ionic tabs --no-deps
    

    Then navigate into the project folder, set up your proxy config as above, and run npm install.

A note on your npm info output

Looking at the npm info output you shared, the package details seem a bit unusual (e.g., the tarball points to appapp-1.0.0.tgz instead of an Ionic-related package). This suggests that npm might be pulling the wrong package due to proxy/registry issues—fixing the proxy config should resolve this mismatch.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.29 08:16:21