How do I install a ionic plugin from the github repository? - ionic-framework

The npm install docs explains how to install a dependency from the github source code rather than using the npm registry.
It works well when your project isn't scoped, so that if I wanna install express I can just execute:
npm install https://github.com/expressjs/express
and it works well.
In the ionic plugin case, though, this doesn't work correctly.
Ionic plugins are scoped, if I want to install the speech recognition plugin from the npm registry I can just execute:
npm install #ionic-native/speech-recognition
This is the #ionic-native/speech-recognition npm page.
On the right sidebar there's the link to the corresponding github page, which is https://github.com/ionic-team/ionic-native.
If I try to execute:
npm i https://github.com/ionic-team/ionic-native/speech-recognition
It installs only the #ionic-native dependency rather than the plugin.
The same about:
npm i #ionic-native/speech-recognition#https://github.com/ionic-team/ionic-native
In both cases, the output is:
#ionic-native/speech-recognition#https://github.com/ionic-team/ionic-native
npm WARN #ionic-native/ionic-webview#5.28.0 requires a peer of
#ionic-native/core#^5.1.0 but none is installed. You must install peer
dependencies yourself. npm WARN uglifyjs-webpack-plugin#0.4.6 requires
a peer of webpack#^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3.0.0 but
none is installed. You must install peer dependencies yourself.
ionic-native#5.28.0 updated 1 package and audited 1602 packages in 38.072s
Which only adds the following row in the package.json:
"ionic-native": "git+https://github.com/ionic-team/ionic-native.git"
If you are asking why I need it, it's because I need to install a forked repo.
How can I install a ionic plugin from the github repository?
Thank you

Most of the plugins used by the Ionic Framework where created for Cordova/Phonegap way before Ionic was published. These are the main technologies that Ionic was built uppon, so you can find the information where and how to download the plugins from the Cordova and Phonegap Github pages or official website.
Speech Recognition for Cordova

Related

Using a Cordova plugin with Capacitor

I've been working through this example:
https://capacitor.ionicframework.com/docs/basics/cordova
I've run:
npm install cordova-plugin-qrscanner
npx cap sync
and I can see the plugin installed in my node_modules.
What I do not know how to do is call one of the functions on the cordova-plugin. I'm wondering if I need a packager like webpack?
I'm also confused as to how this works if the cordova plugin contains native swift (or other) code.
Remember you can install the native wrapper too. It should work just the same as using it with Cordova.
npm install #ionic-native/qr-scanner
From:
ionic cordova plugin add cordova-plugin-qrscanner
npm install #ionic-native/qr-scanner
To:
npm install cordova-plugin-qrscanner
npm install #ionic-native/qr-scanner
npx cap sync
https://ionicframework.com/docs/native/qr-scanner

Difference between "ionic cordova plugin add" and "npm install #ionic-native/plugin --save"

I have been trying to use the ionic-native plugins provided by Ionic 3. When I read the install instructions, there are always 2 command lines instead of one.
ionic cordova plugin add cordova-plugin-camera
npm install --save #ionic-native/camera
If my memory serves me right, only a single command similar to ionic plugin add somepluginhere will get the job done in the old days.
What are the differences here?
The difference is they are different packages.
ionic cordova plugin add
This command will download the cordova plugin - in this case, camera and set the config.xml , package.json, save in plugins folder and set it for each of your platforms.
Ionic leverages the cordova CLI to do this.
ionic-native
Ionic Native is simply a wrapper to the corresponding plugin.
npm install --save #ionic-native/camera
It installs the package #ionic-native/camera to your node-modules folder and sets that in package.json and nothing more.
This wrapper allows you to inject the corresponding cordova plugin as an Angular provider wherever you need instead of trying to declare the global variable and other workarounds.

IONIC keeps saying the plugin is not installed

To be more specific, the plugins are: #ionic-native/estimate-beacons and #ionic-native/ibeacon. I have followed all the steps and also add the plugin into my app's module. This also happens once to my #ionic-native/ble.
Here are the console logs:
and:
Am I missing any step? I'm getting very frustrated since the project is stuck right at the beginning.
P/s: I'm using IONIC and Cordova ' newest version. I follow the docs to install the plugin:
$ ionic cordova plugin add cordova-plugin-estimote
$ npm install --save #ionic-native/estimote-beacons
then
After installing a plugin’s package, add it to your app’s NgModule.
After that, I DO see the plugin shows up in the plugins folder. All finished but everytime got asked to install the plugin!!!

How to solve: Detected locally installed Ionic CLI, but it’s too old -- using global CLI?

ionic -v results in this warning:
[WARN] Detected locally installed Ionic CLI, but it’s too old -- using global CLI.
How to uninstall local Ionic CLI?
ionic-cli has been updated to version 4.0.1 a couple of days ago.
https://github.com/ionic-team/ionic-cli/blob/develop/CHANGELOG.md
You should remove local cli by npm remove ionic --save-dev and use global one instead.
npm i -g ionic
PS: For ionic v1 project, you have to install #ionic/v1-toolkit now.
https://www.npmjs.com/package/#ionic/v1-toolkit
I had this issue on my app as well.
I no longer had '#ionic/cli' or 'ionic' as a dependency, but every time I re-ran "npm i" it would return as a locally installed item. Looking through my package-lock.json I saw that it was also being installed as a dependency of #types/ionic which I then removed and solved this issue as well.
Remove old ionic:
npm remove ionic
And then install ionic v 4.0.1:
npm install ionic#latest --save
Remove local Ionic CLI npm package:
npm rm ionic --save

How can I update to the not yet officially released Ionic 1.2?

Ionic 1.2 has been announced:
http://blog.ionic.io/announcing-ionic-1-2/
The source code is availible here:
https://github.com/driftyco/ionic/releases/tag/v1.2.0
But I haven't been able to install with with some shell commands that I have attempted:
$ bower install --save ionic#1.2.0
$ bower install https://github.com/driftyco/ionic/archive/v1.2.0.tar.gz
$ bower install driftyco/ionic-bower#v1.2.0 --force
I can download the source code but don't know how to use it to update my ionic framework
You can install it with bower using:
$ bower install ionic#1.2.0 --force
Anyway, you should take into account that this will only download libraries and source code, but not a CLI tool.
So in my opinion, if you want to test ionic 1.2, you should
Create an ionic project (as usual)
Perform bower install ionic#1.2.0 --force, in order to get the new ionic libs
Replace in your project the content of www/lib/ionic/ with the content of the recently downloaded bower_components/ionic/release/.
DETAIL: Ionic uses to include a .bowerrc file that causes bower packages to be placed in www/lib, instead of inside bower_components, so maybe you'll simply need to replace the content of www/lib/ionic/ with www/lib/ionic/release (--force is need because www/lib/ionic already exists).