I am using the Ionic CLI behind a corporate proxy. I have configured CNTLM (0.92.3) to allow the use of command line tools. All Ionic commands work as expected except for two; the Ionic upload and ionic package commands both ignore all proxy settings. I have tried the commands on Ionic Beta and on many other versions of the Ionic framework with the same results:
There was an error trying to upload your app.
An error occurred uploading the build: The specific error message: Error: socket
hang up
The specific error message: Error: socket hang up (CLI v2.0.0)
My system information:
Cordova CLI: 6.2.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.2.4
Ionic CLI Version: 2.0.0
Ionic App Lib Version: 2.0.0-beta.20
OS: Windows 7 SP1
Node Version: v4.4.4'
I’ve also tried several GitHub solutions that suggest modifying the following files and using an npm package named https-proxy-agent. I’ve tried every suggested solution in each of the threads with no success.
form_data.js
package.json
upload.js
https://github.com/driftyco/ionic-cli/issues/290https://github.com/driftyco/ionic-app-lib/pull/58
https://github.com/form-data/form-data/pull/179
did you tried this :
$ export HTTP_PROXY="http://proxy.example.com:8888"
$ export HTTPS_PROXY="https://proxy.example.com:8888"
$ export IONIC_HTTP_PROXY="http://proxy.example.com:8888"
$ npm config set proxy http://proxy.company.com:8888
$ npm config set https-proxy https://proxy.company.com:8888
$ git config --global http.proxy http://proxy.example.com:8888
Nevermind that I got this to install successfully. The issue now is that after I managed to fix it and install it.. Later on it fails again. I can't seem to understand what this has to do with..
Running this command on our existing ionic project renders the error below.
ionic add ionic-platform-web-client
Failed to find the bower component "ionic-platform-web-client".
Are you sure it exists? (CLI v1.7.14)
Your system information:
Cordova CLI: 6.1.1
Ionic Version: 1.3.0
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: Not installed
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v4.4.3
Xcode version: Xcode 7.3 Build version 7D175
So I went ahead and pretty much uninstalled everything from the npm, bower, node, ionic, the platforms.. Wiped out the the project from the top to the bottom and IT WORKED!! ionic add ionic-platform-web-client installs!
BUT then
After sometime.. Whenever I come back to the project and run other commands like, ionic plugin add phonegap-plugin-push it fails again. Its very confusing. Does anyone know where the issue stems from?
ionic add <component name> runs bower install --save-dev <component name>. See these lines:
https://github.com/driftyco/ionic-cli/blob/3d675b1584b5921ca05aad6af17d84fd691e7b0c/lib/ionic/add.js#L16-L30
https://github.com/driftyco/ionic-cli/blob/3d675b1584b5921ca05aad6af17d84fd691e7b0c/lib/ionic/add.js#L78-L82
Try to running:
bower install --loglevel=debug ionic-platform-web-client and see if you get any glimpse on the issue.
Installed Ionic successfully. When running ionic info and other commands like ionic browser --list, I get an error that cordova is lower then version 4.
Cordova is installed with no sudo and in global home directory.
> ionic info
Your system information:
Cordova CLI: 6.1.0 (cordova-lib#undefined)
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Distributor ID: Ubuntu Description: Ubuntu 15.10
Node Version: v5.9.1
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly suggested to install/upgrade the following:
Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
Cordova installation is at:
> which cordova
/home/user_1/.npm-global/bin/cordova
Ionic installation is at:
> which ionic
/home/user_1/.npm-global/bin/ionic
I am using cordova#6.2 and ionic#1.7 as well. After I got this error message, I opened a new terminal and typed cordova -v which outputted:
? May Cordova anonymously report usage statistics to improve the tool over time?
As soon as I entered my answer (No), the version number printed out and then I re-ran ionic info in my project terminal. The error was gone.
Caveats
I had just updated ionic#1.7.16 from 1.7.15. It's a very minor patch with one set of bug fixes that are not related to this.
The particular system that I had this problem with is running Windows 10.
The first time I ran ionic info in my project directory, I got the same error twice.
Original Error Output:
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
Your system information:
You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.2.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic CLI Version: 1.7.16
Ionic App Lib Version: 0.7.3
OS:
Node Version: v4.4.2
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
I've tried a lot of different methods to resolve this, like reinstall with and without the --unsafe-perm=true --allow-root flags (which is how others advised to fix it on other questions/other places online) but it seems to be an issue with cordova at version 6.1.0 and ionic so for now use 6.0.0 by running
npm install -g cordova#6.0.0
That should do the trick as it is seems 6.1.0 isn't a stable version.
cordova telemetry off
Made the error disappear when running
ionic info
I chose to opt out of Telemetry which collects data during development for analytics. You can also opt in by using the "on" keyword instead.
Hat tip to Wayne Bloss for guiding me to this answer.
I had exactly the same result as Wayne Bloss on Windows 10. The error "> = 4.2.0" on the first attempt, and after checking the version "cordova -v", the error was gone (I answered Yes to the question on statistics).
As stated by Wayne Bloss this warning disappears when answering the question triggered by the command cordova -v. This worked also for my configuration using Cordova 6.3.1.
This works because the original reason for this is that the version information string for Cordova CLI not only contains the version number but also this piece of information "You have been opted out of telemetry. To change this, run: cordova telemetry on." which makes the internal evaluation of the string with semver return always false. Answering the telemetry question with "no" removed the string from the version thus making the warning message disappear.
I just ran into this so I found this page and seems like no proper answer so here is one.
Installing the cordova-cli deb package requires to:
Add the Ubuntu Cordova Personal Package Archive to your Ubuntu system
Install the cordova-cli package (and its dependencies)
So, for ubuntu
sudo apt-add-repository ppa:cordova-ubuntu/ppa
sudo apt-get update
sudo apt-get install cordova-cli
More info here
https://cordova.apache.org/docs/en/latest/guide/platforms/ubuntu/index.html
As others have noted, a possible cause of this is noise from cordova telemetry.
The issue is still present in cordova 6.5.0 and ionic 2.2.2.
As an additional piece of information, I would like to add that the following has to be run for the current user, e.g. if you have a CI system that installs cordova as root and then runs ionic as a non-privileged user, you will have to run
cordova telemetry off
again.
D:\>ionic start myapp blank
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
Creating an Ionic app in D:\myapp based on the blank template.
Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
Downloading: https://github.com/driftyco/ionic-starter- blank/archive/master.zip
Installing npm packages (may take a minute or two)...
/
? ♫ ? ♫ Your Ionic app is ready to go! ? ♫ ? ♫
The Ionic application is started without any issue of Cordova updating.
You can however, use the following code to update:
npm update -g cordova
It's well written in the caveat, You need to install cordova in your npm using npm install -g cordova
or
npm install -g cordova#4.2.0
Problem solved!
I'm trying to install ionic-platform-web-client but keep getting this error..
Users-iMac:Beluga ryan$ ionic add ionic-platform-web-client
Failed to find the bower component "ionic-platform-web-client".
Are you sure it exists? (CLI v1.7.10)
Your system information:
Cordova CLI: 5.4.0
Ionic Version: 1.1.1
Ionic CLI Version: 1.7.10
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.8.2
ios-sim version: 5.0.3
OS: Mac OS X El Capitan
Node Version: v5.0.0
Xcode version: Xcode 7.1.1 Build version 7B1005
This did it for me: bower install --save-dev ionic-platform-web-client
The resolved issue on github is here.
Try installing bower with this command line
npm install -g bower
Try installing git for windows, make sure to enable writing the git to your PATH during the installation:
https://git-scm.com/download/win
I installed ionic using the following command:
npm install -g ionic
After navigating to node_modules/ionic folder on my local machine and opening the package.json file, it says that the version is 1.6.4
However the ionicframework.com website says the latest version is
1.1.0 "xenon-xerus"
This is quiet confusing. Can someone clarify
You need to differentiate between the ionic CLI (version 1.6.4) and the ionic lib in your application project (version 1.1.0).
if you type ionic -v you'll get the version of the CLI (command line interface)
if you go into your project folder and type ionic lib you'll get the lib version.
Btw: You update the library with ionic lib update
Latest version: 1.7.8
Run npm install -g ionic to update
check version ----
ionic --version
1.7.8
run following command in terminal/cmd: ionic info that command will give you full details of ionic and Cordova installed in your pc and project.
And then you can use npm install -g ionic for install latest ionic build.