ionic-cli: Adding plugin from URL doesn't update package.json
Using command (example plugins):
ionic plugin add org.apache.cordova.contacts
will add an entry to package.json => cordovaPlugins array:
"cordovaPlugins": [
"org.apache.cordova.contacts"
]
But using such command (adding plugin from url, not package name):
ionic plugin add https://github.com/cordova-sms/cordova-sms-plugin.git
Wont add any entries to cordovaPlugins.
However, after use:
ionic state save
we got in package.json:
"cordovaPlugins": [
"org.apache.cordova.contacts",
{
"locator": "https://github.com/cordova-sms/cordova-sms-plugin.git",
"id": "com.cordova.plugins.sms"
}
],
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 35 (1 by maintainers)
@mhhansen @mehrad-rafigh Have a look to the previous @jakub-g comment. I think you should use the --save option. It’s the same effect but in the
config.xmlfile.After all, this isn’t that bad. That don’t really make sens to store Cordova plugins informations (who’s managed by Cordova) in the NPM file. It seems more clear to store Cordova’s stuff in Cordova’s config file.
It works on ionic 1.7.14 Make sure you run
ionic plugin addnotcordova plugin addcommand.This should be working in the latest beta -
npm install -g ionic@beta.also happens to me:
running:
doesn’t add nothing to package.json. Although:
Also nothing on package.json after this:
@wardenlzr If you ever see that error, it means the plugin you’re trying to add doesn’t yet support Cordova 7. You can either downgrade to Cordova 6 or open an issue in the repo for that Cordova plugin.
+1
this won’t add
pluginNameintopackage.json:but I’ve managed to save it by running (not sure why, ref article):
ionic state save@tobiasfiechter I don’t know but I did it since there is no other way to tack installed plugin at the moment
Ionic version
2.0.0-beta.17, the issue still persists. I am trying to run:ionic plugin add ../cordova-plugin-ble-central(which is a cloned repository with my own change). Plugin is installed but nothing is added topackage.jsonfile.also still seeing this issue. I have to manually keep my package.json up to date