Ionic App Version - ionic-framework

I can't install ionic native App Version.
When I write "ionic cordova plugin add cordova-plugin-app-version" shows next message:
How can I fix it??
λ ionic cordova plugin add cordova-plugin-app-version
> cordova plugin add cordova-plugin-app-version --save
× Running command - failed!
[ERROR] An error occurred while running cordova plugin add cordova-plugin-app-version --save (exit code 1):
Error: Failed to fetch plugin cordova-plugin-app-version via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 4294963229 Error output:
npm ERR! path C:\Users\Xu\Documents\github\rheumaiq_app\node_modules\es6-promise-plugin\package.json
npm ERR! code ELOOP
npm ERR! errno -4067
npm ERR! syscall open
npm ERR! ELOOP: too many symbolic links encountered, open
'C:\Users\Xu\Documents\github\rheumaiq_app\node_modules\es6-promise-plugin\package.json'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Xu\AppData\Roaming\npm-cache\_logs\2017-10-18T14_44_39_797Z-debug.log
UPDATE:
Thanks a lot!!
But the problem is not App Version, is with es6-promise-plugin in node_modules.
package.json
...
"es6-promise-plugin": "file:node_modules/es6-promise-plugin",
...
this folder is empty, I dont know what I have to do.

You have a typo
Here is how it should be
cordova plugin add cordova-plugin-appversion
Your mistake most likely results from the github repo being
https://github.com/Rareloop/cordova-plugin-app-version
But npm version name differs from the git repo name.

You can try cordovas --nofetch option to work around problems like this since cordova 7.0.0:
cordova plugin add cordova-plugin-appversion --nofetch
See the release notes for cordova 7.0.0 here to read more about the --nofetch mode.

The problem is not that it is empty, the problem is that it is a symbolic link that points to itself and therefore does not work. A loop is created.
If you delete the folder node_modules/es6-promise-plugin you will see that it is created again each time you type npm install...
I have seen this efect occurs adding the android platform, when try to do it for the cordova-plugin-x-socialsharing plugin, with the 5.2.1 version.
With the v5.2.0 that does not happen.
You can change your version:
ionic cordova plugin remove cordova-plugin-x-socialsharing --force
ionic cordova plugin add cordova-plugin-x-socialsharing#5.2.0 --force
Or you can change in your package.json the version to use.

Related

how to install ionic capacitor contact native plugin

When i try to install "npm install #awesome-cordova-plugins/contacts" in ionic 6, am getting error as follows
npm ERR! 404 Not Found - GET https://registry.npmjs.org/#awesome-cordova-plugins%2fcontacts - Not found
npm ERR! 404
npm ERR! 404 '#awesome-cordova-plugins/contacts#*' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url. ```
how can i resolve this issue. same issue is happening for uid also.
According to the cordova-contacts-plugin repo here, the cordova-contacts-plugin is deprecated since Nov 27, 2017.
As there is deprecation notice on it's npm repository.
The plugin that is currently in the ionic docs is abandoned but it seems like ionic docs is not updated since then.
I think u have to use this one now:
https://github.com/capacitor-community/contacts
https://www.npmjs.com/package/#capacitor-community/contacts
After installing dependencies you need to sync
ionic cap sync
then run your project. you see no error and successfully run
for more info about this plugin click here
You can install the individual cordova plugins (like contacts) with with #ionic-native/contacts and cordova-plugin-contacts

Cordova plugin geolocation not getting installed

I am developing an ionic 4 application. I want to add geolocation plugin and use "ionic cordova plugin add cordova-plugin-geolocation" for the same. On executing the commandI get error
cordova.cmd plugin add cordova-plugin-geolocation
npm: Command failed with exit code 1 Error output:
npm ERR! code E400
npm ERR! 400 Bad Request - GET https://registry.npmjs.org/cordova-plugin-geolocation
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\username\AppData\Roaming\npm-cache\_logs\2019-09-10T08_17_48_727Z-debug.log
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd plugin add cordova-plugin-geolocation exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Can you use below commands from you ionic project directory
ionic cordova plugin add cordova-plugin-geolocation
npm install #ionic-native/geolocation

cordova failed to download plugin cordova-custom-config

I've been trying exhaustingly to build my ionic app for both ios and android. I've added and removed platforms multiple times. Upgraded and downgraded my ionic app and java JDK but nothing works. Right now the common error seems to be with the plugin 'cordova-custom-config'.
When trying to add the ios platform through the command $ sudo ionic cordova platform add ios#latest --fetch --save --verbose the error is:
Discovered plugin "cordova-custom-config" in config.xml. Adding it to the project
Failed to restore plugin "cordova-custom-config" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin cordova-custom-config#^5.0.1 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code 1
npm ERR! Command failed: /usr/local/bin/git clone -q git://github.com/xiangpingmeng/plist.js.git /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-87b2ddaf
npm ERR! /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-87b2ddaf/.git: Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/adamgoldberg/.npm/_logs/2018-02-07T04_04_30_105Z-debug.log
--save flag or autosave detected
Saving ios#latest into config.xml file ...
[ERROR] Exception:
When trying to add android platform through the command $ sudo ionic cordova platform add android#6.3.0 --fetch --save --verbose the error is the same as for ios. Please note that i'm adding android#6.3.0 and not android#latest because latest (7.0.0) is buggy.
When I try to add the cordova-custom-config plugin by itself through the command $ sudo cordova plugin add cordova-custom-config --fetch --verbose the error is:
(node:16626) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch plugin cordova-custom-config#^5.0.1 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code 1
npm ERR! Command failed: /usr/local/bin/git clone -q git://github.com/xiangpingmeng/plist.js.git /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-0ad7ea7b
npm ERR! /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-0ad7ea7b/.git: Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/adamgoldberg/.npm/_logs/2018-02-07T04_12_20_482Z-debug.log
(node:16626) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Here is my ionic info
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.1.8
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
ios-sim : 6.0.0
Node : v8.8.1
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : /Users/adamgoldberg/Library/Android/sdk
Misc:
backend : pro
It seems to be a problem when attempting to install into a project which previously contained an old version of the plugin.
Try cleaning out previous remnants:
rm -Rf node_modules/cordova-custom-config and rm -Rf plugins/cordova-custom-config
If still having issues, install with new cordova-fetch option
cordova plugin add cordova-custom-config --fetch
Go to plugin directory :
cd plugins/cordova-custom-config/
Install manually
npm install

Ionic 3 Google Maps Plugins

am using Ionic 3-Angular 4 to build an app, and I am trying to add Google Maps native SDK plugin and I keep getting the following Error:
Error: Failed to fetch plugin file:node_modules/cordova-plugin-googlemaps via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 4294963229 Error output:
npm ERR! path C:\Users\shawe\Desktop\Xampp Server\Ionic\beitelmagdes\node_modules\cordova-plugin-googlemaps\npm-shrinkwrap.json
npm ERR! code ELOOP
npm ERR! errno -4067
npm ERR! syscall open
npm ERR! ELOOP: too many symbolic links encountered, open 'C:\Users\shawe\Desktop\Xampp Server\Ionic\beitelmagdes\node_modules\cordova-plugin-googlemaps\npm-shrinkwrap.json'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shawe\AppData\Roaming\npm-cache_logs\2017-11-16T07_43_23_428Z-debug.log
[ERROR] An error occurred while running cordova plugin add cordova-plugin-googlemaps --variable
API_KEY_FOR_ANDROID=AIza... (exit code 1).
Please Help
I was having the same problem and seemed to be an issue with the repro. It is now working nicely if you follow the ionic-native documentation:
https://ionicframework.com/docs/native/google-maps/
$ ionic cordova plugin add cordova-plugin-googlemaps --variable
API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable
API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"
$ npm install --save #ionic-native/google-maps

ionic 3 npm install error

I'm getting the following error when i run "npm install" inside my ionic project. I didn't get this error earlier. I even tried creating a new application using "ionic start myApp blank" command. Even then i get the same error while npm install is runing.
Please advice, is this due to something broken at ionic end, or could it be a fault in my pc?
By the way I'm using ionic 3.
npm WARN deprecated object-keys#0.2.0: Please update to the latest object-keys
npm ERR! Unexpected end of input at 1:19096
npm ERR! ctories":{},"dist":{"shasum":"518f921aeb0560aec7dcab2990b14cf6f3cce5d
Try "sudo npm install -g ionic"