j3k0 / cordova-plugin-openwith

Get your Cordova App in the O.S. "Share" menu on iOS and Android
MIT License
138 stars 114 forks source link

NPM version is outdated #63

Closed joshoconnor89 closed 5 years ago

joshoconnor89 commented 5 years ago

Im on cordova 9.0, and when I run:

ionic cordova plugin add cc.fovea.cordova.openwith --variable ANDROID_MIME_TYPE="image/*" --variable IOS_URL_SCHEME=clickupshareextension --variable IOS_UNIFORM_TYPE_IDENTIFIER=public.image

I get the following error:

Plugin "cc.fovea.cordova.openwith" already installed on android.
Installing "cc.fovea.cordova.openwith" for ios
Failed to install 'cc.fovea.cordova.openwith': CordovaError: Using "requireCordovaModule" to load non-cordova module "child_process" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
    at Context.requireCordovaModule (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/Context.js:57:15)
    at module.exports (/Users/josh.0/Desktop/clickup_ionic/plugins/cc.fovea.cordova.openwith/hooks/npmInstall.js:24:33)
    at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:181:32)
    at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:157:16)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:125:20
    at process._tickCallback (internal/process/next_tick.js:68:7)
Using "requireCordovaModule" to load non-cordova module "child_process" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

I cannot figure out how to get past this. Do I need to rollback cordova to 8.1.2? And its weird it only happens to ios. Android installs fine

joshoconnor89 commented 5 years ago

seems like the command is installing an older version. Not quite sure why

ionic cordova plugin add cc.fovea.cordova.openwith --variable ANDROID_MIME_TYPE="image/*" --variable IOS_URL_SCHEME=shareextension --variable IOS_UNIFORM_TYPE_IDENTIFIER=public.image

I forked the repository and did the following and it worked. Still a mystery why, as I did absolutely nothing in the forked repo:

ionic cordova plugin add https://github.com/joshoconnor89/cordova-plugin-openwith.git --variable ANDROID_MIME_TYPE="image/*" --variable IOS_URL_SCHEME=shareextension --variable IOS_UNIFORM_TYPE_IDENTIFIER=public.image

NiklasMerz commented 5 years ago

Sorry you had issues with this. There should be fix there. I guess this is because the version on NPM (installed via ionic cordova plugin add cc.fovea.cordova.openwith) is quite outdated. I am using the not best practise method of installing it via Github (cordova plugin add https://github.com/j3k0/cordova-plugin-openwith .....).

@j3k0 Should the version on NPM be updated? Can you do that or give access to me?

j3k0 commented 5 years ago

@NiklasMerz sure. What's your npmjs.com identifier?

NiklasMerz commented 5 years ago

Just like Github niklasmerz https://www.npmjs.com/~niklasmerz

NiklasMerz commented 5 years ago

I just published v1.3.0. Please test this version.