ionic-cli: Ionic 3 CLI unable to start project behind proxy

I’m facing proxy issues while getting started with Ionic 3.

After installing Ionic 3 & cordova via npm tried to create a new project with the below command as suggested by ionic help

ionic start helloWorld blank --type ionic-angular but the project start fails with below error.

Error: getaddrinfo ENOTFOUND github.com github.com:443

Have already set the required proxies and explained the issue in SO as well. Kindly check http://stackoverflow.com/questions/44021003/ionic-3-cli-unable-to-start-project-behind-proxy

Have installed npm install -g @ionic/cli-plugin-proxy as well. Kindly guide in resolving this issue.

  • OS : Windows 7
  • Node : 7.8.0
  • npm : 4.0.3
  • ionic : 3.1.2
  • cordova : 7.0.1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 68 (15 by maintainers)

Most upvoted comments

Has anyone found the solution / workaround?

I can confirm that it works behind a proxy since version 3.3.0. Many thanks for the fix.

@JPinlac Awesome. I’ll check on Windows as soon as I can.

@kabeza We look at environment variables for the proxy address: https://github.com/driftyco/ionic-cli#using-a-proxy

Can confirm that it works behind proxy after upgrading the CLI to 3.3.0 Thanks for the fix 👍

global packages:

    @ionic/cli-plugin-proxy : 1.3.0
    @ionic/cli-utils        : 1.3.0
    Ionic CLI               : 3.3.0

System:

    Node       : v6.10.3
    OS         : Windows 7
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

@dwieeb This issue is only affecting people on Windows in my team.

ahaha my fault. It’s a timeout error, just the same error as @kabeza

> ionic start my-cool-app blank --skip-deps --verbose
[DEBUG] Load global plugin @ionic/cli-plugin-proxy
[INFO] Fetching app base (https://github.com/driftyco/ionic2-app-base/archive/master.tar.gz)
[DEBUG] !!! ERROR ENCOUNTERED !!!
✖ Downloading - failed!
Error: connect ETIMEDOUT 192.30.253.112:443
[DEBUG] Error: connect ETIMEDOUT 192.30.253.112:443
            at Object.exports._errnoException (util.js:1018:11)
            at exports._exceptionWithHostPort (util.js:1041:20)
            at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)

I’ve also update to the latest Node.js (6.10.3), npm (4.6.1) and Ionic (3.2.0) but I get the same error.

Thanks

if this is a self signed cert issue then you can temporarily set an environment variable NODE_TLS_REJECT_UNAUTHORIZED=0 then clear the variable when you are done

github.comgithub.com:443 ???

@tahniat-ashraf @Navitam Did you follow the instructions here? There is another step. You must export an environment variable such as HTTP_PROXY.

Does not work for version 3.9.2

Thanks for the fix. Update works for me

Thanks for the fix. Latest client version also works for me 👍

@oikonomopo We also look for the following env variables: https://github.com/ionic-team/ionic-cli#using-a-proxy

The proxy environment variables do expect a full, properly formatted connection string.

I tried downgrading to 2.2.3 as @jppampin and can confirm it worked fine, without making any changes for the proxy

sudo npm uninstall -g ionic 
sudo npm install -g ionic@2.2.3
ionic start pruebaApp

Creating an Ionic 2.x app in /home/user/pruebaApp based on the tabs template.
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
Downloading: https://github.com/driftyco/ionic2-starter-tabs/archive/master.zip
Installing npm packages (may take a minute or two)...
\
♬ ♫ ♬ ♫  Your Ionic app is ready to go! ♬ ♫ ♬ ♫
Some helpful tips:
Run your app in the browser (great for initial development):
  ionic serve
Run on a device or simulator:
  ionic run ios[android,browser]
Share your app with testers, and test on device easily with the Ionic View companion app:
  http://view.ionic.io

None of the following variables works. IONIC_HTTP_PROXY http_proxy HTTP_PROXY HTTPS_PROXY PROXY

I had to downgrade to 2.2.3 and it works. ordova CLI: 7.0.1 Ionic Framework Version: 3.3. Ionic CLI Version: 2.2.3 Ionic App Lib Version: 2.2.1 Ionic App Scripts Version: 1. ios-deploy version: Not insta ios-sim version: Not installe OS: Windows 7 Node Version: v6.10.3 Xcode version: Not installed

I used the command: npm install -g ionic@legacy --save-exact

@datencia while searching for my issue, I remember that I found once method for TIMEOUT issue.

Lemme try finding for you, hope it helps, but wait…

Perhaps you can try setting the “registry” method, and find something related to npm timeout…

I’m having the same issues. the cli-plugin-proxy is installed and all the environment variable were set and I’m getting the following error. Regular GitHub, npm, and git proxies are all setup and work.

$ ionic start app tabs --verbose
[DEBUG] Load global plugin @ionic/cli-plugin-proxy
[DEBUG] globalDeps=
[INFO] Fetching app base (https://github.com/driftyco/ionic2-app-base/archive/master.tar.gz)
[DEBUG] !!! ERROR ENCOUNTERED !!!
✖ Downloading - failed!
Error: getaddrinfo ENOTFOUND github.com github.com:443
[DEBUG] Error: getaddrinfo ENOTFOUND github.com github.com:443
            at errnoException (dns.js:28:10)
            at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)

Here’s my ionic info:

$ ionic info --verbose
[DEBUG] Load global plugin @ionic/cli-plugin-proxy
[WARN] You are not in an Ionic project directory. Project context may be missing.

global packages:

    @ionic/cli-plugin-proxy : 1.2.0
    @ionic/cli-utils        : 1.2.0
    Ionic CLI               : 3.2.0

System:

    Node       : v6.9.1
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
``

Im facing the exact same problem. I also havent faced any issue creating angular cli apps. I think ionic start is skipping the proxy set for github; which is causing this problem.