dpa99c / cordova-check-plugins

A CLI tool to check for / manage plugin updates in Cordova/Phonegap projects.
217 stars 25 forks source link

installing plugin does not works #13

Closed badpenguin closed 7 years ago

badpenguin commented 7 years ago

I'm running cordova-check-plugins --unconstrain-versions --mode=auto --save It says that plugins are installed:

Updating all plugins: ionic-plugin-keyboard, cordova-plugin-console

Updating 'cordova-plugin-console'... /
Removed plugin 'cordova-plugin-console'
Updating 'cordova-plugin-console'... \
Re-added plugin 'cordova-plugin-console'

Updated 'cordova-plugin-console' from 1.0.2 to 1.0.3

Updating 'ionic-plugin-keyboard'... |
Removed plugin 'ionic-plugin-keyboard'
Updating 'ionic-plugin-keyboard'... \
Re-added plugin 'ionic-plugin-keyboard'

Updated 'ionic-plugin-keyboard' from 2.2.0 to 2.2.1

Automatically updated all outdated plugins

But when i go to check both:

the plugins are still at the old version.

dpa99c commented 7 years ago

I'm running cordova-check-plugins --unconstrain-versions --mode=auto --save

If this is the exact command you are running, then the problem is you are using the wrong parameter name: it should be "--update=auto" not "--mode=auto":

cordova-check-plugins --unconstrain-versions --update=auto --save
badpenguin commented 7 years ago

Sorry for the typo. I didn't copied it from the command line. However, trying again with the correct command the problem is still the same.

dpa99c commented 7 years ago

OK, I haven't encountered this issue myself, but I'm not using ionic, so it may be related how ionic stores plugin versions as opposed to pure Cordova. I'll create a blank ionic project and see if I can reproduce the issue.

badpenguin commented 7 years ago

I gave you the command to replicate! :)

ionic start --appname "Test Uno" --id com.dominio.test1 --sass -t sidemenu test1

Then install an outdated version with:

cordova plugin remove cordova-plugin-console --save
cordova plugin install cordova-plugin-console@1.0.2 --save

Maybe its a problem with config.xml ?

For console its: <plugin name="cordova-plugin-console" spec="~1.0.2" />

dpa99c commented 7 years ago

Yes, problem was due to pinned versions in config.xml (e.g. spec="~1.0.2") not being overridden when re-installing plugins when --unconstrained-versions option is specified. Fix is published to npm in version 1.1.3 - please update to this latest version. Let me know if it does not resolve the issue for you.

badpenguin commented 7 years ago

Yes! Fixed! Thanks for the super quick solution :)

dpa99c commented 7 years ago

No worries, thanks for taking the time to report the issue :-)