Error while installing any plugin - ionic-framework

I am using the latest version of Ionic and just getting started with the Ionic Framework. I am trying to add plugins to my projects but always I gets error something like as shown in image. I have checked my internet connection and tried to install some other plugins also but I get the same error always.

Try uninstalling cordova
npm uninstall cordova -g
and installing latest version
npm install -g cordova

Related

Ionic and cordova(Latest versions) installation problems

I'm trying to install the Ionic framework with npm. It successfully installed. But when I try installing new versions of Ionic and Cordova, I was unable to install and Error messages are coming frequently in the ubuntu terminal.
I had a same problem but i recovered it using following command:
npm install -g cordova ionic --verbos
if its not work then you need to try yarn. you can download and install form https://yarnpkg.com/lang/en/docs/install/ this website
After install, run the following command
yarn add global cordova
yarn add global ionic

Plugin error while building ionic app

during build ionic app, this error is shown:
Error occurred during command execution from a CLI plugin (#ionic/cli-plugin-cordova). Your plugins
may be out of date.
TypeError: env.runcmd is not a function
This error message indicates that the Ionic CLI version is incompatible with other CLI plugins (see https://github.com/ionic-team/ionic/issues/12561).
Please run the following commands in your project directory (where you package.json is):
npm i -g ionic#latest
npm i --save-dev --save-exact ionic#latest
This will install the latest Ionic CLI version (currently 3.7.0) globally and locally. After that the error should no longer occur.
If you have ionic cli version lower than 3.6.0 try to update it. It resolved the issue for me.

npm uninstall not working for ionic

I have ionic cli installed in my PC
Windows 10 OS
as per new ionic release the beta has to be uninstalled and new ionic need to be installed.
https://github.com/driftyco/ionic/releases
But when I try to uninstall ionic using npm
npm uninstall -g ionic
also
npm uninstall -g ionic#2.0.0-beta.25
after uninstall
I did
npm list -g
the ionic was not shown in the output.
But upon everything when I type
ionic -v or ionic --version
I still see ionic 2.0.0-beta25 in my console.
Tried this multiple times and also there was a solution in forum by one who says there might be old entry. But I am not sure from where this is getting picked.
Is there a way to find out where npm is picking this or where it is installed?
I cant find it under my npm directory.
C:\Users\Bala\AppData\Roaming\npm\node_modules
Output of Where ionic
C:\>where ionic
C:\Program Files (x86)\nodejs\ionic
C:\Program Files (x86)\nodejs\ionic.cmd

Ionic error of Cordova lower version - Please install your Cordova CLI to version >=4.2.0

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!

what is the latest version of ionic build 1.1.0 or 1.6.4

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.