ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Ionic 3 CLI unable to start project behind proxy

Open sharewithamar opened this issue 9 years ago • 68 comments

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

sharewithamar avatar May 19 '17 06:05 sharewithamar

@sharewithamar Can you try with --verbose flag please?

imhoffd avatar May 19 '17 07:05 imhoffd

@dwieeb Here is the result with --verbose flag. Attached screenshot as well.

D:>ionic start helloWorld blank --type ionic-angular --verbose

[DEBUG] Load global plugin @ionic/cli-plugin-proxy

[DEBUG] Checking for latest plugin version of ionic@latest.

"3.1.2"

[DEBUG] Latest version of ionic@latest is .

[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-proxy@ latest.

"1.1.2"

[DEBUG] Latest version of @ionic/cli-plugin-proxy@latest is .

[DEBUG] globalDeps=

Fetching app base (https://github.com/driftyco/ionic2-app-base/archive/ master.ta

r.gz)

[DEBUG] !!! ERROR ENCOUNTERED !!!

? Downloading - failed!

Error: getaddrinfo ENOTFOUND github.comgithub.com:443

[DEBUG] Error: getaddrinfo ENOTFOUND github.comgithub.com:443

        at errnoException (dns.js:28:10)

        at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:73:26)

On 19 May 2017 1:20 p.m., "Dan Imhoff" [email protected] wrote:

@sharewithamar https://github.com/sharewithamar Can you try with --verbose flag please?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/driftyco/ionic-cli/issues/2317#issuecomment-302634504, or mute the thread https://github.com/notifications/unsubscribe-auth/AE_Lf0DvcPhDx3DPZeq9W6S_OjiXl3cVks5r7UmrgaJpZM4NgHa_ .

sharewithamar avatar May 19 '17 08:05 sharewithamar

github.comgithub.com:443 ???

imhoffd avatar May 19 '17 18:05 imhoffd

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

On Sat, May 20, 2017 at 12:24 AM, Dan Imhoff [email protected] wrote:

github.comgithub.com:443 ???

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/driftyco/ionic-cli/issues/2317#issuecomment-302783469, or mute the thread https://github.com/notifications/unsubscribe-auth/AE_LfzTEA3bi3NNpstovSx2W5npoyZQZks5r7eVZgaJpZM4NgHa_ .

-- Regards, Amar

sharewithamar avatar May 19 '17 18:05 sharewithamar

I assume it has something to do with your server configuration.

imhoffd avatar May 19 '17 19:05 imhoffd

But I don't face any issues while using Angular CLI or npm behind proxy regularly to install libraries. Even Ionic V2 was working fine behind proxy.

After upgrading to 3+ i'm getting this error.

Do I need to ask server team to enable some config or something to be done in my client machine? Kindly let me know.

On 20 May 2017 12:47 a.m., "Dan Imhoff" [email protected] wrote:

I assume it has something to do with your server configuration.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/driftyco/ionic-cli/issues/2317#issuecomment-302788757, or mute the thread https://github.com/notifications/unsubscribe-auth/AE_LfxaCeIDzCkJsLr-DN0frsdIlESkIks5r7eq_gaJpZM4NgHa_ .

sharewithamar avatar May 19 '17 19:05 sharewithamar

Hello my friend, I got similar issue as you, working fine on ionic2, npm, but failed once got upgrade to ionic3.

My error is "self signed certificate in certificate chain".

I am wondering, why it was working on V2, but not for now..

derekstwong avatar May 22 '17 08:05 derekstwong

Also behind proxy...

With [email protected] is working, but not with [email protected]! Any workaround?

$ ionic info --verbose

[DEBUG] Load global plugin @ionic/cli-plugin-proxy
[DEBUG] Checking for latest plugin version of ionic@latest.
"3.1.2"

[DEBUG] Latest version of ionic@latest is .
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-proxy@latest.
"1.1.2"

[DEBUG] Latest version of @ionic/cli-plugin-proxy@latest is .
[WARN] You are not in an Ionic project directory. Project context may be missing.

global packages:

    @ionic/cli-plugin-proxy : 1.1.2
    @ionic/cli-utils        : 1.1.2
    Ionic CLI               : 3.1.2

System:

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


$ ionic start myNewProject blank --type=ionic1 --verbose

[DEBUG] Load global plugin @ionic/cli-plugin-proxy
[DEBUG] Checking for latest plugin version of ionic@latest.
"3.1.2"

[DEBUG] Latest version of ionic@latest is .
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-proxy@latest.
"1.1.2"

[DEBUG] Latest version of @ionic/cli-plugin-proxy@latest is .
[DEBUG] globalDeps=
Fetching app base (https://github.com/driftyco/ionic-app-base/archive/master.tar.gz)
[DEBUG] !!! ERROR ENCOUNTERED !!!
✖ Downloading - failed!
Error: connect ECONNREFUSED 192.30.253.120:443
[DEBUG] Error: connect ECONNREFUSED 192.30.253.120: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)

oikonomopo avatar May 23 '17 07:05 oikonomopo

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.

tahniat-ashraf avatar May 24 '17 10:05 tahniat-ashraf

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

76foxtrot avatar May 24 '17 14:05 76foxtrot

Hi guys I'm having the same problem, but am working in ElementaryOS (Ubuntu 14.04 based version) You can see the commands output

mypc:~$ ionic start pruebaApp --verbose
[DEBUG] Load global plugin @ionic/cli-plugin-proxy
? What starter would you like to use: blank
[DEBUG] globalDeps=
[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)

And here the ionic info

mypc:~$ 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.10.3
    OS         : Linux 4.4
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

Of course, I've set apt proxy, configured proxy in bash, etc. Tried also with PROXY=..... ionic start pruebaApp Tried with sudo

Proxy works fine everywhere. I've updated npm and ionic from terminal without errors before getting this problem

Thanks

kabeza avatar May 24 '17 17:05 kabeza

Hi all, I'm facing the same issue (also behind a proxy...)

$ ionic info
[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.1.2
    @ionic/cli-utils        : 1.2.0
    Ionic CLI               : 3.2.0

System:

    Node       : v6.9.4
    OS         : Windows 8.1
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

datencia avatar May 25 '17 08:05 datencia

@datencia try feedback from @76foxtrot "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".

I am now ok for starting project, but failed to build, with blocking https

derekstwong avatar May 25 '17 08:05 derekstwong

Thx @derekstwong, but that solution is not working for me :(

I will keep trying...

datencia avatar May 25 '17 09:05 datencia

@datencia , not sure what error given from your cli.

are you trying to start a project with "timeout" error or "self signed cert" error? Just try updating to the latest Node.js and npm at this moment first

derekstwong avatar May 25 '17 09:05 derekstwong

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

datencia avatar May 25 '17 10:05 datencia

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
``

JPinlac avatar May 25 '17 19:05 JPinlac

Can anyone confirm the request is actually making it to their proxy server?

I am using Charles Proxy (https://www.charlesproxy.com/) to test this locally and every request during start is making it through the proxy.

imhoffd avatar May 25 '17 20:05 imhoffd

hi, i tried to start via charles proxy like below image.

image

but... there are no any request from ionic-cli.

its my environment.

D:\study\git>ionic info --verbose
[DEBUG] Load global plugin @ionic/cli-plugin-proxy
[DEBUG] Getting plugin info for ionic
[DEBUG] Getting plugin info for @ionic/cli-plugin-proxy
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-proxy@latest.
[DEBUG] Latest version of ionic@latest is 3.2.0.
[DEBUG] Latest version of @ionic/cli-plugin-proxy@latest is 1.2.0.
[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       : v7.8.0
    OS         : Windows 7
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

enif-lee avatar May 26 '17 01:05 enif-lee

@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...

derekstwong avatar May 26 '17 01:05 derekstwong