Hi
I would like to use NPM to install custom Cordova plugins. Currently I go to the GitHub page and download as a zip, and copy it into the plugins folder which is very manual. Can I use NPM? I mean, I can use NPM to get the plugins, but how would I get them from the node_modules folder into the correct folder for the AppBuilder build?
Thanks
Stephen
4 Answers, 1 is accepted
In the AppBuilder CLI, to add a custom plugin to your application, you could use the plugin fetch plugin command where "plugin" is a local path to the plugin, a plugin repository or the name/id of the plugin in the registry. For example:
// From Plugin Repository
appbuilder plugin fetch https://github.com/phonegap/phonegap-plugin-barcodescanner
// From NPM Registry
appbuilder plugin fetch phonegap-plugin-barcodescanner
Please, let me know if this is helpful.
Regards,
Garo
Telerik by Progress
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

Hi Garo
Does this update a package.json or just copy the files into the plugin folder? Do we then need to commit these files to source control? I'm assuming there is no actual tracking of the packages it just copies them in, just like if I copy them in myself? So another developer wouldn't do a package restore before developing?
Thanks
Stephen
Straight to your questions:
- Telerik AppBuilder Cordova projects do not have a package. file. The command shared by my colleague just copies the files of a plugin into the "plugins" folder.
- You do need to commit the files to the source control as they are already local files.
- You are correct, you can copy the files by yourself. Once you start a cloud build, these files will be also uploaded and included in the final executable file.
- I am not absolutely sure what do you mean with this question thus, please excuse me if my answer is not on the topic. If you are collaborating with another developer on the same project but he does not use functionality added with a custom plugin by you, he can continue his development without pulling the last committed changes.
Regards,
Preslav
Telerik by Progress
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

Hi Preslav
I just mean that usually with NPM the packages aren't in source control (you might have 1Gb of packages...) but each developer does an NPM Install or whatever to download them onto their machine.
I think you have answered all of my questions, thanks. I am a little disappointed that there isn't proper actual package management using a package.json but I can live without it I guess.
Thanks
Stephen