ionic-team / ionic-cli

The Ionic command-line interface
MIT License
2k stars 645 forks source link

Ionic 3 CLI unable to start project behind proxy #2317

Closed sharewithamar closed 7 years ago

sharewithamar commented 7 years ago

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.

ghost commented 6 years ago

Still not working for me but found a workaround by using a VPN while running ionic start.

pakwoc commented 6 years ago

Version 3.9.2 & 3.9.1 not work, downgrade to 3.3.0 works again.

nandankanitkar commented 6 years ago

Does not work for version 3.9.2

imhoffd commented 6 years ago

@pakwoc @nandankanitkar I haven't been able to reproduce this issue. Can you make a new issue and fill out the issue template?

juanmonsalveh commented 6 years ago

it still not working for version 3.9.2

imhoffd commented 6 years ago

@juanmonsalveh I haven't been able to reproduce this issue. Can you make a new issue and fill out the issue template?

nandankanitkar commented 6 years ago

Sorry for the delay in replying, it seems to be working now. Thanks!

Regards, Nandan Kanitkar 9769594947

On Wed, Sep 6, 2017 at 4:40 AM, dwieeb notifications@github.com wrote:

@juanmonsalveh https://github.com/juanmonsalveh I haven't been able to reproduce this issue. Can you make a new issue and fill out the issue template?

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

juanmonsalveh commented 6 years ago

@dwieeb I just ended working under proxy, right now I have no problems, thank you

tahniat-ashraf commented 6 years ago

Facing similar problem again -_- helloworld Please note that I have all the proxies placed for npm and git - git config --global http.proxy http://ip:port git config --global https.proxy http://ip:port npm config set proxy http://ip:port npm config set https-proxy http://ip:port

Navitam commented 6 years ago

image Hi I'm facing the same issue for above ionic info. Can someone please suggest

imhoffd commented 6 years ago

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

tahniat-ashraf commented 6 years ago

@dwieeb : I managed to fix the problem earlier by placing the system variables (HTTPS_PROXY,HTTP_PROXY) like you were saying. Worked like charm.

Note: Fresh installers, who work behind a company proxy, make sure to configure git proxy and npm proxies before installing ionic and ionic proxy. git : git config --global http.proxy http://IP:PORT npm: npm config set proxy http://proxy.company.com:PORT npm config set https-proxy http://proxy.company.com:PORT After that, install ionic cordova and ionic proxy cli - 1) npm install -g ionic cordova 2) install ionic proxy cli following - https://ionicframework.com/docs/cli/configuring.html#using-a-proxy

imhoffd commented 6 years ago

Thanks @tahniat-ashraf I added a note about configuring other CLIs in our documentation: https://ionicframework.com/docs/cli/configuring.html#other-clis 👍

amad4biz commented 6 years ago

This worked as a charm, the secret was to start by configuring the git proxy, and then everything else work

captainhook99999 commented 6 years ago

I ran into this problem today and after a whole day's struggling, I fixed it. I was behind a proxy server.

First, make sure you can use "git" properly. Because IONIC use git to download starter templates.

git config --global http.sslverify false
git config --global http.sslcainfo "path to your certificate file *.crt"

(You may also set "user.name" and "user.email" values if you have a git hub account.)

Second, let "npm" not to check ssl certificate

npm config set strict-ssl false
npm config set registry "http://registry.npmjs.org/" --global

Third, make "Node.js" not to check ssl certificate. On Windows Powershell, type

$env:NODE_TLS_REJECT_UNAUTHORIZED ="0"

Then try again.

ionic start blank blank

Good Luck.

captainhook99999 commented 6 years ago

What's more. npm doesn't delete "C:\Users\yourname\.ionic" folder even if you reinstall IONIC. Check it out.

imhoffd commented 6 years ago

@captainhook99999

The Ionic CLI does not use git to download starters unless you specify a git url.

Turning off SSL verification anywhere could not be discouraged more. If you are getting SSL issues, you likely need to update your system to get new CA certificates installed OR you are behind a proxy and your system or proxy is improperly configured. Talk with your proxy server administrator.

imhoffd commented 6 years ago

Locking this issue. If new problems arise from proxying Ionic CLI requests, you are more than welcome to create a new issue.

If you need to configure your environment for a proxy: