I've successfully installed Cordova (clean install, under Windows), and I'm able to deploy a small app to Android, but unable to add any plugins behind my company's proxy. I've already tried setting every possible npm and git variable I could think of via:
npm config set proxy url:port
npm config set http-proxy url:port
npm config set https-proxy url:port
(replaced url:port with the actual proxy) and
git config --system --add http.proxy url:port
git config --global --add http.proxy url:port
but to no avail.
Every time I run something as simple as
cordova plugin add org.apache.cordova.splashscreen
I get the following:
Fetching plugin "org.apache.cordova.splashscreen" via plugin registry
Error: Fetching plugin failed: Error: read ECONNRESET
at C:\Users\x\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:105:41
at _rejected (C:\Users\x\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:24)
at C:\Users\x\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:834:30
at Promise.when (C:\Users\x\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\x\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:752:41)
at C:\Users\x\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:574:44
at flush (C:\Users\x\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)
Any help would be much appreciated!
The issue can be solved by setting HTTP_PROXY before you run the phonegap command:
set HTTP_PROXY=http://username:password@proxyhost:proxyport
Where your username:password is your login credentials. It's not using the setting in nodejs.
On unix you wouldn't use set.
One easy way if you don't manage to make git work behind a proxy (sorry I won't be able to help you with that) is to
cordova plugin add pathtotheextractedplugingit
There are several ways to get the url of a plugin git repo, one of them is to go on phonegap build plugin listing page and then click on the plugin you need to get it's url.
For the splash screen plugin it would be https://github.com/apache/cordova-plugin-splashscreen
This solution work form me in windows. In your user folder: C:\Users\your_user_name.gradle If exists a file called gradle.properties Edit & add
systemProp.http.proxyHost=[Proxy_IP]
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=[your_username]
systemProp.http.proxyPassword=[your_password]
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
systemProp.https.proxyHost=[Proxy_IP]
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=[your_username]
systemProp.https.proxyPassword=[your_password]
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
If the file does not exists, create it. Replace the text between [] with your right data. Obviously, the [] must be deleted. I left the "proxyPort" with 8080 because is the default in the most of cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With