I am trying to develop a custom plugin in cordova that give me location at every specified interval. Problem is that I don't have any package.json file in this plugin directory.
When I am trying to add this plugin into our cordova project i am getting Invalid package.json error.
Please help me I am new in cordova. What i have to do to resolve this error.
I am using this command to add the plugin in project
cordova plugin add ../loccation_plugin/LocationPlugin/
I had same issue while adding my custom plugin to project. I am using plugman tool to create custom plugin and you may most probably be using plugman tool too.
If that is the case then execute following command to generate valid package.json
:
plugman createpackagejson "path of your plugin"
This will ask you some basic question about plugin and will generate package.json file based on it.
I meet the same 'pkg is not defined' problem, then I try to use npm init
to create package.json file and succeed.
I had the same issue, but used this npm init
instead, press Enter and fill in the data as asked on the cmd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With