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

709 Views Asked by At

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/[email protected] requires a peer of @ionic-native/core@^5.1.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] 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.

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

1

There are 1 best solutions below

1
On

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