Using Ionic / NodeJS behind a proxy


I’m new to Ionic / NodeJS and have been trying to start a sample project following the instructions on the Getting Started page, but I’ve ran into a problem when trying to pass through the company’s proxy when executing the “ionic start myApp tabs” command.

I’ve been able to configure NodeJS by setting the “http” and “https-proxy” properties, but this configuration seems to be completely ignored by the “ionic” command :

C:\ionic>ionic start myApp tabs Running start task... Creating Ionic app in folder C:\ionic\myApp based on tabs project DOWNLOADING: TypeError: Cannot read property 'statusCode' of undefined at Request._callback (C:\Users\yba\AppData\Roaming\npm\node_modules\ionic\lib\ionic.js:241:13) at self.callback (C:\Users\yba\AppData\Roaming\npm\node_modules\ionic\node_modules\request\request.js:129:22) at Request.EventEmitter.emit (events.js:95:17) at ClientRequest.self.clientErrorHandler (C:\Users\yba\AppData\Roaming\npm\node_modules\ionic\node_modules\request\request.js:239:10) at ClientRequest.EventEmitter.emit (events.js:95:17) at CleartextStream.socketErrorListener (http.js:1547:9) at CleartextStream.EventEmitter.emit (events.js:95:17) at Socket.onerror (tls.js:1445:17) at Socket.EventEmitter.emit (events.js:117:20) at net.js:441:14

The problem I face (and the workaround I’m using) is described there.

Is it normal ? If not should I file an issue for this ?

Thank you for your help,


I have the same problem!!!

I don’t know if anyone solved it. Can you try some of the options listed here:

I have the same problem too!

Hey guys,

Are you all on Windows, or other OSes?

As a temporary solution, you could use a tool like Proxifier ( to automatically do this for the ionic start command. I need to look into seeing how to make this configurable on our end, I would just expect it to work automatically through global node settings but I guess not.

@max Perhaps use an .ionicrc file in the project root to define some custom Ionic related settings? Just like Bower and JSHint.

Work for me.

1 Like

@max I’m Mac OS X 10.9.2

There’s been an update the CLI that should take care of this.

$ sudo npm uninstall -g ionic
$ sudo npm install -g ionic
$ PROXY= ionic start what

I am using latest version of ionic, but still I face the above error. Using your answer I have fixed it.


1 Like

I still have this problem, I’m going to try and follow the blog mentioned

Is there a Windows equivalent of PROXY= please?

Thank you

(love Ionic btw, it’s transformed me and my partners development, if you’re ever in Somerset, England we owe you beers).

1 Like

Oh, I resolved it - you need to set an Environment Variable in windows for PROXY :slight_smile:

Thank you


I have proxy setup for npm install. I can create ionic app but can’t upload it. any solution ?



C:_Source2324\12345>set proxy=http://1x.y.z.k:8080

C:_Source2324\12345>ionic start mySMSApp tabs
Creating Ionic app in folder C:_Source\SMSApp\mySMSApp based on tabs project
[=============================] 100% 0.0s
[=============================] 100% 0.0s
Updated the hooks directory to have execute permissions
Update Config.xml
Initializing cordova project

Your Ionic project is ready to go! Some quick tips:

  • cd into your project: $ cd mySMSApp

  • Setup this project to use Sass: ionic setup sass

  • Develop in the browser with live reload: ionic serve

  • Add a platform (ios or Android): ionic platform add ios [android]
    Note: iOS development requires OS X currently
    See the Android Platform Guide for full Android installation instructions:

  • Build your app: ionic build

  • Simulate your app: ionic emulate

  • Run your app on a device: ionic run

  • Package an app using Ionic package service: ionic package

For more help use ionic --help or ionic docs

Visit the Ionic docs:

Create an account to send Push Notifications and use the Ionic View app
(Y/n): n



Thanks! The solution provided by @mhartington solved this issue I was having with the f… building’s proxy

For windows you can also set an Environment variable called PROXY.
It worked for me.

1 Like

hey how to set in windows please give me some example .
Thank You.

in your config file you have to mention proxies property as below

“proxies”: [
“path”: “/api”,
“proxyUrl”: “

Worked for me.Thanks.

On commandline: set PROXY=http://your_company_proxy:8080

1 Like

set PROXY=http://(…)