How can I get a plugin to work by installing it NOT from the repository.
Each plugin I try to install using phonegap plugin add <<git repository>>
always results in different errors, because windows + npm just doesn't want to work for me...
This is the plugin I need: https://github.com/VersoSolutions/CordovaClipboard
My steps:
phonegap plugin add <<downloaded and extracted directory>>
But cordova.plugins.clipboard
is still undefined. Do I have to put the clipboard.js file somewhere or reference it? If so, which version?
The one in the clipboard project or the one phonegap automatically creates within the platform/android directory (it puts a "define" around it). I actually tried both, but the object was still undefined.
The clipboard plugin does not have a package.json
present which is why you are getting the error. You can either add a package.json
file to the plugin or you can install it with the --nofetch
flag:
cordova/phonegap plugin add https://github.com/VersoSolutions/CordovaClipboard.git --nofetch
Since cordova 7.0.0 npm install
is run by default when adding a new plugin which causes an error if no package.json
is present. You can find the release notes for cordova 7.0.0 here.