Closed zoltan-mihalyi closed 3 years ago
@aidanas proposed a fix in PR #874. I forked his fork and contributed a unit test as well for completeness: PR aidanas/cordova-lib#1.
See also previous closed issue which partially fixed the problem, and a follow-up comment which likely is about this same issue: https://github.com/apache/cordova-lib/issues/832#issuecomment-901946362.
Bug Report
Problem
When dependencies and devDependencies are both present, running
cordova prepare
installs the wrong platform version.What is expected to happen?
Using cordova-fetch for cordova-electron@2.0.0
is printedWhat does actually happen?
Using cordova-fetch for cordova-electron@1.0.0
is printedInformation
Environment, Platform, Device
the relevant part of my package.json:
Solution
I managed to find the problem in this line: https://github.com/apache/cordova-lib/blob/master/src/cordova/platform/addHelper.js#L102
If "dependencies" exists, the code skips the devDependencies.
Version information
cordova-lib@10.0.0
Checklist