I've run into this "Failed to fetch plugin error" quite frequently lately. It seems especially easy to prop up if I download my own branch:
t2wu@THW-air:~/Documents/Work/John/DEMO_APP/BCAppII(dev) $ cordova plugin add https://github.com/t2wu/cordova-plugin-geofence.git#t2wu
Error: Failed to fetch plugin https://github.com/t2wu/cordova-plugin-geofence.git#t2wu via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL. Failed to get absolute path to installed module
If I download a plugin like cordova plugin add cordova-plugin-geofence
, but when I have to use a specific repo, especially a branch on that repo, it fails frequently.
I am using Cordova 7.1.0. (Cordova 8 have other issues I'm not willing to touch right now.)
For anyone who faced this problem, it turns out cordova is trying to fetch via registry every time when repo name do not match with plugin id. I was able to install plugins from private bitbucket just changing the repo name
Try the following:
cordova plugin add https://github.com/t2wu/cordova-plugin-geofence.git#t2wu --nofetch
If it doesn't work. Do the following step:
Remove all platform (cordova platform rm android
) and (cordova platform rm ios
)
Remove all plugins cordova plugin rm plugin-name
.
If step2 failed, then delete all plugins using a file manager from directory <projectroot>/plugins
Add all plugins
Add https://github.com/t2wu/cordova-plugin-geofence.git#t2wu
Add all platform.
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