apache / cordova-cli

Apache Cordova CLI
Apache License 2.0
940 stars 340 forks source link

Older cordova-lib packages redirect to cordova-lib@12.0.2 #653

Closed fabriciovasc closed 3 weeks ago

fabriciovasc commented 3 weeks ago

Bug Report

Problem

What is expected to happen?

Cordova 12 continues to work on platforms with node 14 or older

What does actually happen?

When version 12 is installed, cordova-lib@12.0.1 is not installed as described in package.json

The cordova-lib@12.0.2 package is kept as default

Information

Command or Code

Try to install cordova@12 and check version

npm i -g cordova@12
cordova -v

Expected:

12.0.0 (cordova-lib@12.0.1)

Got:

12.0.0 (cordova-lib@12.0.2)

Environment, Platform, Device

ionic info
Ionic:

   Ionic CLI          : 6.0.0 (/home/gitlab-runner/.nvm/versions/node/v14.21.3/lib/node_modules/@ionic/cli)
   Ionic Framework    : ionic-angular 3.9.8
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 13.0.0-dev (cordova-lib@12.0.1)
   Cordova Platforms : Warning: using prerelease version 13.0.0-dev (cordova-lib@12.0.1), android 13.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 35 other plugins)

Utility:

   cordova-res : 0.15.4
   native-run  : not installed

System:

   NodeJS : v14.21.3 (/home/gitlab-runner/.nvm/versions/node/v14.21.3/bin/node)
   npm    : 6.14.18
   OS     : Linux 6.1

Version information

Ionic:

   Ionic CLI          : 6.0.0 (/home/gitlab-runner/.nvm/versions/node/v14.21.3/lib/node_modules/@ionic/cli)
   Ionic Framework    : ionic-angular 3.9.8
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 13.0.0-dev (cordova-lib@12.0.1)
   Cordova Platforms : Warning: using prerelease version 13.0.0-dev (cordova-lib@12.0.1), android 13.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 35 other plugins)

Utility:

   cordova-res : 0.15.4
   native-run  : not installed

System:

   NodeJS : v14.21.3 (/home/gitlab-runner/.nvm/versions/node/v14.21.3/bin/node)
   npm    : 6.14.18
   OS     : Linux 6.1

Checklist

Attachments

cordova-lib after installed in node_modules image

fabriciovasc commented 3 weeks ago

Temp solution

I forked and forced the cordova-lib version

https://github.com/fabriciovasc/cordova-cli/commit/2b12aee06ec2531379df3f87af9a6a4f7fa31ab2

breautek commented 3 weeks ago

This is intentional. We don't pin on exact versions, we pin using ^, which means the latest version within the major range. This is so installs and npm upgrade will pull in the latest patches for bug fixes. These are non-breaking changes.

NodeJS 14 is also out of support since 2023. Cordova dropped support for NodeJS 12 - 16 in v12, making the minimum NodeJS 18 which was the active LTS at the time of release.

fabriciovasc commented 3 weeks ago

This is intentional. We don't pin on exact versions, we pin using ^, which means the latest version within the major range. This is so installs and npm upgrade will pull in the latest patches for bug fixes. These are non-breaking changes.

NodeJS 14 is also out of support since 2023. Cordova dropped support for NodeJS 12 - 16 in v12, making the minimum NodeJS 18 which was the active LTS at the time of release.

Yes, I understand that it is intentional.

But there are many projects with ionic 3 and angular 4 using the latest cordova with node 14.

If you can move to a topic that helps other developers with the same stack.

Thanks for the reply.

breautek commented 3 weeks ago

Yes, I understand that it is not intentional.

Installing the latest patches available IS intentional.

But there are many projects with ionic 3 and angular 4 using the latest cordova with node 14.

cordova@11 is the last version to support NodeJS 14. So if you require NodeJS 14 a specific reason, then you'll need cordova@11, which will install cordova-lib@11.