Plugin cordova without a package.json ... How add it?

I want tou use a cordova plugin from a repo, but when i’m doing a cordova add plugin “namerepo” i’m facing an npm install error and if i want to add it manual way i get an error (needs a valid package.json).

Thanks

Please post the exact errors you are getting.

In general:

  1. Get the plugin fixed
  2. Fork the plugin and add a package.json
  3. Install with --nofetch might also help

It’s a cordova plugin. https://github.com/BetterVoice/bv-bgs-foreground

If i do: cordova plugin add https://github.com/BetterVoice/bv-bgs-foreground.git

Error: Failed to fetch plugin https://github.com/BetterVoice/bv-bgs-foreground.git 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 4294963228 Error output:
npm ERR! addLocal Could not install

If i add the plugin with this structure:

c:\
   + MyService\
      + src\
      |   + android\
      + www\

And then do the :

cordova plugin add c:\MyService

get the package.json failure