apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

Missing module "cordova-common" for ios platform add. (Cordova 6.5.0) #1207

Closed smcnary closed 2 years ago

smcnary commented 2 years ago

Issue Type

Description

I'm having an issue running a build using a mac os X 11 build in azure devops. I'm using cordova 6.5.0 and cordova ios 6.0.0. It's keeps giving me the error that I'm missing "cordova-common". I've tried doing an npm i -g cordova-common, but I'm still getting the error nonetheless. I've tried using the latest version of cordova and tooling but get the same error.

Information

image

Command or Code

Console Commands: npm i -g cordova@6.5.0 npm i -g cordova-common cordova platform add ios@6.0.0

Environment, Platform, Device

OS: macOS 11

Version information

Cordova 6.5 Operating System : Mac OSX 11 Cordova IOS 6.0.0

Checklist

breautek commented 2 years ago

cordova 6.5.0

This is an ancient version that is no longer supported. The latest cordova cli version is 10.0.0.

cordova platform add ios@6.0.0

Any particular reason you're using 6.0.0 exactly? Version 6.0.0 has some known issues which have been patched. I can't recall if cordova-common issues is one of them or not. The latest version currently is 6.2.0

No need to install cordova-common manually. They are dependencies of both cordova-cli and cordova-ios and will likely have their own versions installed in their own node_modules folder.

I've tried using the latest version of cordova and tooling but get the same error.

To be clear, you've tried with cordova-ios@6.2.0 andcordova@10.0.0` ?

smcnary commented 2 years ago

Thanks for your response, I'm trying to create an android and ios build using a single azure devop build pipeline.

This is an ancient version that is no longer supported. The latest cordova cli version is 10.0.0.

Using the latest Cordova CLI version was breaking the android build. Switching the version to 6.5.0 seemed to fix this issue. The error was as follows: image

To be clear, you've tried with cordova-ios@6.2.0 and cordova@10.0.0` ?

I'll remove the android build step to see if the ios build works.

In the meantime, is there a fix for the issue I'm having with the cordova-sqlite-storage storage plugin?

Thanks for your help.

breautek commented 2 years ago

In the meantime, is there a fix for the issue I'm having with the cordova-sqlite-storage storage plugin?

I use cordova-sqlite-storage@6.0.0 successfully in my apps.

Older versions of Cordova allowed used to expose cordova's dependencies via requireCordovaModule method which was never intentional. But plugins used to consume cordova's dependencies rather than declaring/importing their own dependency. This obviously created brittle code and made it very hard for Cordova to update without breaking plugins that did this practice. cordova-sqlite-storage@6.0.0 appears to have these bad practices corrected.

smcnary commented 2 years ago

@breautek Correcting issues in package.json (we had older versions listed) as well as removing all specific installs in our build pipeline corrected the issue. Thanks for your help.