Harsh
Harsh

Reputation: 11

behind proxy error while ionic installation via npm

npm ERR! npm v2.14.7

npm ERR! code ECONNRESET

npm ERR! errno ECONNRESET

npm ERR! syscall read

npm ERR! network read ECONNRESET

npm ERR! network This is most likely not a problem with npm itself

npm ERR! network and is related to network connectivity.

npm ERR! network In most cases you are behind a proxy or have bad network settings.

npm ERR! network

npm ERR! network If you are behind a proxy, please make sure that the

npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! Windows_NT 6.1.7601

npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "-d" "ionic"

npm ERR! node v4.2.2

npm ERR! npm v2.14.7

npm ERR! code ECONNRESET

npm ERR! errno ECONNRESET

npm ERR! syscall read

npm ERR! network read ECONNRESET

npm ERR! network This is most likely not a problem with npm itself

npm ERR! network and is related to network connectivity.

npm ERR! network In most cases you are behind a proxy or have bad network settings.

npm ERR! network

npm ERR! network If you are behind a proxy, please make sure that the

npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "-d" "ionic"

npm ERR! node v4.2.2

npm ERR! npm v2.14.7

npm ERR! code ECONNRESET

npm ERR! errno ECONNRESET

npm ERR! syscall read

npm ERR! network read ECONNRESET

npm ERR! network This is most likely not a problem with npm itself

npm ERR! network and is related to network connectivity.

npm ERR! network In most cases you are behind a proxy or have bad network settings.

npm ERR! network

npm ERR! network If you are behind a proxy, please make sure that the

npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! Windows_NT 6.1.7601

Upvotes: 1

Views: 8396

Answers (4)

Joseph Campbell
Joseph Campbell

Reputation: 39

Add IONIC_HTTP_PROXY to System variable helped me.

https://ionicframework.com/docs/cli/configuration#using-a-proxy

Environment Variables The CLI will look for the following environment variables:

IONIC_CONFIG_DIRECTORY: The directory of the global CLI config. Defaults to ~/.ionic. IONIC_HTTP_PROXY: Set a URL for proxying all CLI requests through. See Using a Proxy. IONIC_TOKEN: Automatically authenticates with Ionic Appflow.

Upvotes: 1

Albaz
Albaz

Reputation: 935

npm config set <key> <value> [-g|--global]
npm config get <key>
npm config delete <key>
npm config list
npm config edit
npm get <key>
npm set <key> <value> [-g|--global]

npmrc.txt will run you can change your link and port

proxy =http://proxy.company.com:8080

 https-proxy = http://proxy.company.com:8080

reference

Upvotes: 3

hadican
hadican

Reputation: 161

It seems you are trying to install Ionic on Windows over proxy. You need to apply below steps.

First, you need to configure npm to use proxy. On command line execute below commands. (This will create .npmrc file on your home directory.)

npm config set proxy http://host:port
npm config set https-proxy http://host:port
npm config set strict-ssl false

Secondly, you need to configure Ionic to use proxy to start a project. Define below environment varible on Windows:

Varible name: PROXY (capitalized)
Varible value: http://host:port

Lastly, if you will add Android platform to your project, you need to make proxy configurations to build application too. In order to do that, create/edit below file:

C:\Users\your_user_name\.gradle\gradle.properties

Create/edit gradle.properties file as:

systemProp.http.proxyHost=host
systemProp.http.proxyPort=port
systemProp.http.nonProxyHosts=localhost 

systemProp.https.proxyHost=host
systemProp.https.proxyPort=port
systemProp.https.nonProxyHosts=localhost

Upvotes: 5

Abhinav Suryawanshi
Abhinav Suryawanshi

Reputation: 161

Try

npm cache clean

If you are running node behind proxy you may want to set http_proxy and https_proxy using below command

npm config set proxy http://proxy.company.com:8080

npm config set https-proxy http://proxy.company.com:8080

Upvotes: 1

Related Questions